import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class StartPage extends StatefulWidget { // final bool isFirst; // // StartPage(this.isFirst); @override State createState() { return _StartPage(); } } class _StartPage extends State { @override Widget build(BuildContext context) { return Container( color: Colors.white, width: double.infinity, height: double.infinity, child: Image.asset( "assets/image/ic_splash_bg.webp", width: double.infinity, height: double.infinity, // fit: BoxFit.cover, ), ); } @override void initState() { super.initState(); Future.delayed(Duration(seconds:2), () { // Navigator.of(context).popAndPushNamed((widget.isFirst ?? true) ? // '/router/guide_Page' : '/router/new_login_page'); Navigator.of(context).popAndPushNamed('/router/main_page'); }); } }