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

套件詳情v0.2.2

your_splash

一個 Flutter 的啟動畫面實作。支援 Android 和 IOS。

近 30 天下載
28
喜歡數
7
Pub 分數
40

安裝套件

flutter pub add your_splash

套件介紹

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

YourSplash 是一個 Flutter 套件,為 Android 和 iOS 平台提供簡單且有效的啟動畫面實作。它允許開發者在應用程式初始化期間顯示可自訂的啟動畫面,進而提升啟動時的使用者體驗。此套件可無縫整合至 Flutter 項目,並支援平台特定的設定。僅需最少設定,即可確保從啟動畫面到主應用介面的順暢過渡。

適用情境

  • 應用入門畫面
  • 初始加載狀態顯示
  • 應用發佈期間的品牌推廣
  • 在導航前預加載資源
  • 流暢的應用啟動體驗

主要特色

  • 跨平台支援(Android 與 iOS)
  • 與 Flutter 的輕鬆整合
  • 可自訂的啟動畫面外觀
  • 自動切換到主螢幕
  • 最小配置要求

適合對象

  • 新 Flutter 項目
  • 需要品牌啟動畫面的應用程式
  • 尋求輕量級啟動畫面解決方案的開發者
  • 需要資源預加載的專案
  • 簡單的啟動畫面實現

使用建議

  • 不支援網頁平台
  • 超出基本樣式的客製化功能有限
  • 無內建動畫控制
  • 依賴手動計時進行轉換
  • 需要妥善的資產管理才能獲得最佳效果

原始 README

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

your_splash

pub package license build codecov Say Thanks!

A Flutter implementation of splash screen. Supports Android and IOS.

Features

  • Supports splash screen with the Future callback
  • Supports splash screen with timer

Getting Started

To use this library, add your_splash as a dependency in your pubspec.yaml file:

dependencies:
  ...
  your_splash:

In your library add the following import:

import 'package:your_splash/your_splash.dart';
Constructors

This package comes with 2 kinds of splash screen actions:

  • FuturedSplashScreen
  • TimedSplashScreen

You can create a splash screen in two different ways:

  • by calling FuturedSplashScreen or TimedSplashScreen constructor and passing required arguments.
  • by calling SplashScreen.futured or SplashScreen.timed constructor respectively.

A FuturedSplashScreen requires next arguments:

Parameter Description
future This is your Future callback for delay
route This is a dynamic argument. Can be String name of route or PageRoute instance
body This is a body of your splash screen

A TimedSplashScreen requires next arguments:

Parameter Description
seconds This is a duration in seconds for how long your splash screen will be displayed
route This is a dynamic argument. Can be String name of route or PageRoute instance
body This is a body of your splash screen
Examples

Quick start example:

import 'package:flutter/material.dart';
import 'package:your_splash/your_splash.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SplashScreen.timed(
        seconds: 3,
        route: MaterialPageRoute(builder: (_) => Home()),
        body: Scaffold(
          body: InkWell(
            child: Container(
              decoration: const BoxDecoration(
                image: DecorationImage(
                  fit: BoxFit.cover,
                  image: NetworkImage('https://bit.ly/3hD5Tj8'),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Home screen!"),
      ),
      body: Center(
        child: Text(
          "Welcome!",
          style: TextStyle(fontWeight: FontWeight.bold, fontSize: 40.0),
        ),
      ),
    );
  }
}

How can I animate transition between the splash screen and navigation page?

Overview

route: PageRouteBuilder(
  pageBuilder: (context, animation, secondaryAnimation) => Home(),
  transitionDuration: Duration(seconds: 1),
  transitionsBuilder: (_, animation, secAnim, child) {
    var tween = Tween(begin: 0.0, end: 1.0).chain(
      CurveTween(curve: Curves.easeInOutCirc),
    );
    return FadeTransition(
        opacity: animation.drive(tween), child: child);
  },

You can see all examples here

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。