只需添加一个带有延迟功能的小部件
void main() {
runApp(DisplayLogo());
}
class DisplayLogo extends StatefulWidget {
@override
_State createState() => _State();
}
class _State extends State<DisplayLogo> {
initState() {
super.initState();
///add delay here
Timer(Duration(seconds: 2), () {
if(mounted)
runApp(MainApp());
});
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Center(
child: FlutterLogo(size: 300),
));
}
}