Splash页
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: MySplashPage(),
);
}
}
class MySplashPage extends StatefulWidget {
@override
_MySplashPageState createState() => _MySplashPageState();
}
class _MySplashPageState extends State<MySplashPage> {
@override
Widget build(BuildContext context) {
return Container(
child: Image(
image: AssetImage('images/splash.png'),
fit: BoxFit.fill,
),
);
}
@override
void initState() {
// 启动的时候将屏幕设置成全屏模式
SystemChrome.setEnabledSystemUIOverlays([]);
super.initState();
// 这里进行1秒后跳转
Timer(
Duration(seconds: 1),
() => Navigator.of(context).pushReplacement(Materi