Add direct path support to access some pages

This commit is contained in:
Moe Poi ~ 2022-05-14 23:29:00 +07:00
parent e6ec1a13ef
commit 8f6ae35e4d

View file

@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
import 'package:page_transition/page_transition.dart'; import 'package:page_transition/page_transition.dart';
import 'package:animated_splash_screen/animated_splash_screen.dart'; import 'package:animated_splash_screen/animated_splash_screen.dart';
import 'package:nekoya_flutter/screens/login.dart';
import 'package:nekoya_flutter/screens/register.dart';
import 'package:nekoya_flutter/components/menu.dart'; import 'package:nekoya_flutter/components/menu.dart';
import 'package:nekoya_flutter/utils/url_strategy.dart'; import 'package:nekoya_flutter/utils/url_strategy.dart';
@ -37,6 +39,14 @@ class _NekoyaState extends State<Nekoya> {
nextScreen: const Menu(initialScreen: 2,), nextScreen: const Menu(initialScreen: 2,),
), ),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
initialRoute: '',
routes: {
'' : (context) => const Menu(initialScreen: 2,),
'/login': (context) => const Login(),
'/register': (context) => const Register(),
'/products' : (context) => const Menu(initialScreen: 1,),
'/cart' : (context) => const Menu(initialScreen: 3,),
},
); );
} }
} }