搜索插件、代码仓与 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,
    ),
));

所属分类

源码仓库

使用此插件的项目

暂无相关数据。