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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。