v1.2.1
another_flutter_splash_screen
一个 Flutter 包,可轻松在您的应用中实现启动屏幕。还提供了仓库中的精选演示。
310喜欢 3070近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
一个用于为您的精美 Flutter 项目创建动态启动屏幕的 Flutter 包。还支持动态下一个屏幕。
以下为英文项目原文快照,最新内容请访问 GitHub。
Supports deciding next screen dynamically. Example here
Supports Immersive Mode (Hide Status Bar in Splash Screen). Example here
Add another_flutter_splash_screen to your pubspec.yaml file and start implementing splash screen easily.
Just add another_flutter_splash_screen as a dependency in your pubspec.yaml file.
dependencies:
another_flutter_splash_screen: <Latest Version>
import 'package:another_flutter_splash_screen/another_flutter_splash_screen.dart';
FlutterSplashScreen.gif(
gifPath: 'assets/example.gif',
gifWidth: 269,
gifHeight: 474,
nextScreen: const MyHomePage(),
duration: const Duration(milliseconds: 3515),
onInit: () async {
debugPrint("onInit");
},
onEnd: () async {
debugPrint("onEnd 1");
},
);
FlutterSplashScreen.fadeIn(
backgroundColor: Colors.white,
onInit: () {
debugPrint("On Init");
},
onEnd: () {
debugPrint("On End");
},
childWidget: SizedBox(
height: 200,
width: 200,
child: Image.asset("assets/dart_bird.png"),
),
onAnimationEnd: () => debugPrint("On Fade In End"),
nextScreen: const MyHomePage(),
);
FlutterSplashScreen.scale(
gradient: const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.lightBlue,
Colors.blue,
],
),
childWidget: SizedBox(
height: 50,
child: Image.asset("assets/twitter_logo_white.png"),
),
duration: const Duration(milliseconds: 1500),
animationDuration: const Duration(milliseconds: 1000),
onAnimationEnd: () => debugPrint("On Scale End"),
nextScreen: const MyHomePage(),
);
FlutterSplashScreen.gif(
...
// go_router example
asyncNavigationCallback: () async {
var response = await userRepository.getUserData();
if(response.status == 200 && response.data.isAuthenticated){
GoRouter.of(context).goNamed("home");
}
else{
// GoRouter.of(context).goNamed("/");
}
},
OR
// Named routing example
asyncNavigationCallback: () async {
await Future.delayed(const Duration(seconds: 3));
if (context.mounted) {
Navigator.pushReplacementNamed(context, "home");
}
},
...
);
FlutterSplashScreen.gif(
useImmersiveMode: true,
gifPath: 'assets/example.gif',
gifWidth: 269,
gifHeight: 474,
nextScreen: const MyHomePage(),
duration: const Duration(milliseconds: 3515),
);
FlutterSplashScreen(
useImmersiveMode: true,
duration: const Duration(milliseconds: 2000),
nextScreen: const MyHomePage(),
backgroundColor: Colors.white,
splashScreenBody: Center(
child: Lottie.asset(
"assets/lottie_loading_2.json",
repeat: false,
),
),
);
FlutterSplashScreen(
duration: const Duration(milliseconds: 2000),
nextScreen: const MyHomePage(),
backgroundColor: Colors.white,
splashScreenBody: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(
height: 100,
),
const Text(
"Custom Splash",
style: TextStyle(color: Colors.black, fontSize: 24),
),
const Spacer(),
SizedBox(
width: 200,
child: Image.asset('assets/flutter.png'),
),
const Spacer(),
const Text(
"Flutter is Love",
style: TextStyle(color: Colors.pink, fontSize: 20),
),
const SizedBox(
height: 100,
),
],
),
),
);
We will be more than happy for your contributions.
Please contribute to another_flutter_splash_screen this github repo.
依赖清单 3 项
{"sdk":"flutter"}{"sdk":"flutter"}^2.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗