【发布时间】:2020-01-13 15:58:46
【问题描述】:
我更喜欢使用自定义启动画面,它允许我构建整个页面。所以,我正在尝试从 android 和 ios 中删除默认的启动画面
void main() async {
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
runApp(MaterialApp(
title: 'Navigation Basics',
debugShowCheckedModeBanner: false,
home: new SplashPage(),
routes: {
// When navigating to the "/" route, build the FirstScreen widget.
'/home': (BuildContext context) => new FirstRoute(),
},
));
}
class SplashPage extends StatefulWidget {
@override
SplashPageState createState() => SplashPageState();
}
class SplashPageState extends State<SplashPage> {
void navigationToNextPage() {
Navigator.pushNamed(context, '/home');
}
startSplashScreenTimer() async {
var _duration = new Duration(seconds: 5);
return new Timer(_duration, navigationToNextPage);
}
@override
void initState() {
super.initState();
startSplashScreenTimer();
}
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays([]);
return Container(
child: new Image.asset('images/banner.png', fit: BoxFit.fill));
}
}
所以我需要用颤振从两者中删除默认启动画面
【问题讨论】:
标签: flutter