Use initialRoute instead of home

This commit is contained in:
Moe Poi ~ 2022-05-21 17:08:45 +07:00
parent 532d1b7e9d
commit 1ec4f6e560

View file

@ -12,8 +12,8 @@ import 'package:nekoya_flutter/utils/navigation_auth.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
usePathUrlStrategy();
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) {
usePathUrlStrategy();
runApp(const Nekoya());
});
}
@ -33,16 +33,16 @@ class _NekoyaState extends State<Nekoya> {
theme: ThemeData(
colorScheme:
ColorScheme.fromSwatch(accentColor: const Color(0xff8B0000))),
home: AnimatedSplashScreen(
splash: 'assets/images/logo_transparent.webp',
pageTransitionType: PageTransitionType.fade,
backgroundColor: const Color(0xff1b1c1e),
splashIconSize: 150,
nextScreen: const Menu(initialScreen: 2,),
),
debugShowCheckedModeBanner: false,
initialRoute: '',
routes: {
'' : (context) => const Menu(initialScreen: 2,),
'' : (context) => AnimatedSplashScreen(
splash: 'assets/images/logo_transparent.webp',
pageTransitionType: PageTransitionType.fade,
backgroundColor: const Color(0xff1b1c1e),
splashIconSize: 150,
nextScreen: const Menu(initialScreen: 2,),
),
'/login': (context) => const Login(),
'/register': (context) => const Register(),
'/products' : (context) => const Menu(initialScreen: 1,),