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

套件詳情v0.0.2

custom_splash

一個 Flutter 套件,用於自訂啟動畫面,例如變更圖示、圖示動畫和啟動畫面背景顏色。

近 30 天下載
81
喜歡數
86
Pub 分數
30

安裝套件

flutter pub add custom_splash

套件介紹

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

一個 Flutter 套件,讓開發者能夠建立高度可自訂的啟動畫面,支援變更 logo 圖示、加入 logo 動畫以及設定背景顏色。此套件簡化了視覺上吸引人的引導畫面實作,無需撰寫複雜的自訂程式碼。該套件設計以易用為導向,並能順暢整合至 Flutter 應用程式中。支援動態樣式與平滑過渡,提升應用程式啟動時的使用者體驗。

適用情境

  • 應用入門畫面
  • 自訂載入體驗
  • 以品牌為中心的啟動畫面
  • 動畫徽標顯示
  • 簡單而優雅的啟動視覺效果

主要特色

  • 自訂徽標圖示取代
  • Logo 動畫支援
  • 背景顏色自訂
  • 與 Flutter 的輕鬆整合
  • 輕量且快速的渲染

適合對象

  • 初學者Flutter開發者
  • 需要品牌化引導的應用程式
  • 帶有動畫UI元素的專案
  • 極簡設計偏好
  • 快速啟動畫面實現

使用建議

  • 有限的平台特定自訂
  • 無內建的啟動畫面持續時間控制支援
  • 需要手動處理濺水後的導航
  • 未針對複雜動畫進行優化
  • 依賴外部相依性以實現進階效果

原始 README

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

Custom Splash Screen

A Flutter package to custom splash screen: change logo icon, logo animation, and splash screen background color. (Custom from animated splash screen)

ProgressDialog Demo
Using the package

Get the library

Things to do
  1. Get a logo for your app
  2. Prepare what to execute while the splash screen is shown (initializing your db, shared preferences, firebase...etc)
  3. Screen to be shown after splash screen and background process
  4. Duration of Splash Screen

Import the package

import 'package:custom_splash/custom_splash.dart';

Show splash screen for some duration

  type: CustomSplashType.StaticDuration

Inside your main function, use home as SplashScreen(_), the parameters are as follows:

imagePath: Path to your app-logo/image

backGroundColor(not require - default: white): background's color (Colors.deepOrange or Color(0xfffc6042))

animationEffect(not require - default: 'fade-in'): change animation of logo. There are: 'fade-in', 'zoom-in', 'zoom-out', 'top-down'.

ProgressDialog Demo

logoSize(not require - default: 250): custom size of logo

home: Screen to be shown after splash

duration: duration of splash screen in milliseconds

type

runApp(MaterialApp(
    home: CustomSplash(
        imagePath: 'assets/flutter_icon.png',
        backGroundColor: Colors.deepOrange,
        animationEffect: 'zoom-in',
        logoSize: 200,
        home: MyApp(),
        customFunction: duringSplash,
        duration: 2500,
        type: CustomSplashType.StaticDuration,
        outputAndHome: op,
    ),
));

Execute a function in background and based on the value from that function navigate to different screen

  type: CustomSplashType.BackgroundProcess

Create an object of Function that gets executed while splash screen is shown

Function duringSplash = () {
  //Write your code here
  ...
  return value;
};

Create routes according to your function return value

  //setup the return value correctly for proper navigation
  Map<dynamic, Widget> returnValueAndHomeScreen = {1: Home(), 2: HomeSt()};

Inside your main function, use home as SplashScreen(_), the parameters are as follows:

imagePath: Path to your app-logo/image home: Screen to be shown after splash customFunction: the function you have written above duration: duration of splash screen in milliseconds type output value of customFunction and home screen to navigate(Map function)

runApp(MaterialApp(
    home: CustomSplash(
        imagePath: 'assets/flutter_icon.png',
        backGroundColor: Colors.deepOrange,
        animationEffect: 'zoom-in',
        logoSize: 200,
        home: MyApp(),
        customFunction: duringSplash,
        duration: 2500,
        type: CustomSplashType.BackgroundProcess,
        outputAndHome: op,
    ),
));

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。