搜尋套件、儲存庫與 APP 分類

splash_view 封面
套件詳情v2.0.1

splash_view

啟動應用程式時,使用者看到的第一個畫面就是啟動畫面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
908
喜歡數
79
Pub 分數
150

安裝套件

flutter pub add splash_view

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

SplashView 是一個專為 Flutter 設計的套件,用於建立可自訂的啟動畫面,當應用程式啟動時顯示。它提供了一種簡單的方式來顯示介紹性內容,例如商標、動畫或品牌資訊,然後過渡到主要應用介面。此套件支援多個平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,確保在各種裝置上提供一致的使用者體驗。透過 pub add 命令進行最少設定,開發者可以輕鬆將專業外觀的啟動畫面整合到他們的應用中。

適用情境

  • 應用入門畫面
  • 品牌介紹
  • 初始加載狀態
  • 預加載資源
  • 過渡到主應用
  • 跨平台啟動畫面

主要特色

  • 跨平台支援
  • 與 pub 的輕鬆整合
  • 可自定外觀
  • 支援資源預加載
  • 可設定的持續時間
  • 簡單 API

適合對象

  • 新 Flutter 項目
  • 需要品牌一致性的應用
  • 尋求快速 splash 实現的開發者
  • 跨平台應用程式
  • 帶有初始資料載入的應用程式
  • 極簡主義使用者介面設計

使用建議

  • 確保啟動畫面持續時間不過長
  • 避免阻擋關鍵應用邏輯
  • 在所有目標平台進行測試
  • 不要過度使用動畫
  • 考慮可訪問性需求
  • 驗證資產加載完成

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

splash-view

chouhan-rahul buymeacoffee ko-fi paypal

Become a sponsor

sponsor

Splash View

A splash view is a short introduction to an application shown when it is launched. In the splash view, basic introductory information, such as the company logo, content, etc. is displayed at the moment the application load.

google apple

Here is an example of how to implement SplashView in a Flutter application. Recommended: Use splash view inside MaterialApp().

void main() {
  runApp(
    MaterialApp(
      home: SplashView(
        logo: FlutterLogo(),
        loading: CircularProgressIndicator(),
        done: Done(HomePage()),
      ),
    ),
  );
}

Properties of SplashView

Property Type Description
logo: Widget Logo of the splash view.
title: Widget Title of the splash view.
subtitle: Widget Subtitle of the splash view.
loadingIndicator: Widget Loading indicator of the splash view.
done: Done Redirect to the next page.
duration: Duration Duration of redirecting to the next page.
backgroundColor: Color Background color of the splash view.
backgroundImageDecoration: BackgroundImageDecoration Background image of the splash view.
gradient: Gradient Gradient background of the splash view.
bottomLoading: bool Show loading indicator on the bottom of the splash view.
showStatusBar: bool Show and hide app status/navigation bar on the splash view.

Redirecting to the next page

SplashView has a property called done, here you can use Done() widget to redirect to the next page.

SplashView(
  done: Done(HomePage()),
)

Redirecting to the next page with an animation effect

Done has two more properties which are used to redirect to the next page with an animation effect. animationDuration is used to set the duration of the animation and curve is used to set the animation curve.

SplashView(
  done: Done(
    HomePage(),
    animationDuration: Duration(seconds: 2),
    curve: Curves.easeInOut,
  ),
)

Properties of Done

Property Type Description
animationDuration: Duration The duration the transition going forwards.
curve: Curve A collection of common animation easing curves.

Background

There are three ways to set the background of the splash view.

Background Color

Background color can be set by backgroundColor property.

microsoft

SplashView(
  backgroundColor: Colors.red,
)

Gradient Color

Gradient color can be set by gradient property.

amazon

SplashView(
  gradient: LinearGradient(
    begin: Alignment.topCenter,
    end: Alignment.bottomCenter,
    colors: <Color>[Colors.green, Colors.blue]),
  ),
)

Background Image

Background image can be set by backgroundImageDecoration property.

gdev

SplashView(
  backgroundImageDecoration: BackgroundImageDecoration(
    image: AssetImage('images/larry-page.jpg'),
  ),
)

Properties of BackgroundImageDecoration

Property Type Description
image: ImageProvider Typically this will be an AssetImage or a NetworkImage
fit: BoxFit Fill the target box by distorting the source's aspect ratio.
colorFilter: ColorFilter A color filter is a function that takes two colors, and outputs one color.
opacity: double Used to set the filterQuality of the image.

Change the position of loading indicator

By default bottomLoading is false. You can change the position of loading indicator to the bottom by setting bottomLoading to true.

SplashView(
  bottomLoading: true,
)

Hide/Show status bar and navigation bar

By default showStatusBar is false. You can show status bar and navigation bar by setting showStatusBar to true.

SplashView(
  showStatusBar: true,
)

Report bugs or issues

You are welcome to open a ticket on github if any problems arise. New ideas are always welcome.

Copyright and License

Copyright © 2022 Rahul Chouhan. Licensed under the MIT LICENSE.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。