一个 Flutter 包,可让开发者在应用程序初始化期间显示带有 Rive 动画的启动画面。它简化了在启动过程中集成流畅、交互式动画的过程,确保用户获得精致的体验。该包会处理加载逻辑,并在初始化工作完成后无缝完成过渡。它支持多种平台,包括移动设备、网页和桌面端,非常适合需要视觉吸引力强的引导体验的应用程序。
适合场景
带有动画启动画面的应用程序引导
加载状态可视化
品牌互动动画
延迟初始化处理
跨平台启动画面
主要特点
Rive 动画支持
初始化后自动过渡
多平台兼容性
简单的设置,代码量最少
可自定义的加载时间
适合对象
寻求动画启动画面的开发者
具有复杂初始化过程的应用程序
强调视觉设计的项目
使用 Rive 进行动画的团队
跨平台应用程序
使用建议
需要 Rive 文件资源
如果动画较大,可能会影响初始加载时间
需要正确的初始化逻辑
超出基本过渡之外的自定义功能有限
取决于 Rive 运行时性能
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
rive_splash_screen
Facilitator for having a Splash screen with a Rive animation until some work has been done for the initialization of the app
Usage
Navigation
The splash screen will show the animation and push the new route you gave once it's finish, by default it does a fade animation but you can customize it by using transitionsBuilder
The splash screen will show the animation and call the onFinished callback when it's finish.
SplashScreen.callback(
name: 'intro.riv',
onSuccess: (data) {
//data is the optional data returned by until callback functionNavigator.of(context).pushReplacement(PageRouteBuilder(pageBuilder: (_,__,___) => MyHomePage(title: 'Flutter Demo Home Page')));
},
onError: (err, stack) {
//error throw by until callback function
},
loopAnimation: '1',
until: () => Future.delayed(Duration(seconds: 1)),
endAnimation: '1',
),
API
name : path/name of the Rive animation
next : screen to show once animation is finished as widget builder
loopAnimation: animation name to run, default same as first param
startAnimation: animation name to run once before going into loop
endAnimation: animation name to run once until is complete
until: callback that return a future to process your initialization
isLoading: alternative to until if you want to manage loading state with a boolean
height: force the height of the Rive animation, by default it take the all place available
width: force the width of the Rive animation, by default it take the all place available
alignment: alignment of the Rive animation, center by default
transitionsBuilder transition to apply when showing next
Available animation mode
Only one animation
Basically you have one animation to show and then just need to stay at last frame. In order to do that only specify the startAnimation
Start and loop animation
Your animation have an intro and a loop state, in order to do that only specify the startAnimation and loopAnimation
End and loop animation
Your animation have a finish and a loop state, in order to do that only specify the endAnimation and loopAnimation
Start and end animation
Your animation have an intro and a finish that should stay on the last frame, in order to do that only startAnimation and endAnimation
Start, end and loop animation
Your animation have an intro, a finish and a loop state, in order to do that specify the startAnimation, endAnimation and loopAnimation