From 8f6ae35e4db4aff2e8cc10768670d83dc0b7454c Mon Sep 17 00:00:00 2001 From: Moe Date: Sat, 14 May 2022 23:29:00 +0700 Subject: [PATCH] Add direct path support to access some pages --- lib/main.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 27af3d4..0b0eec4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; import 'package:page_transition/page_transition.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/utils/url_strategy.dart'; @@ -37,6 +39,14 @@ class _NekoyaState extends State { nextScreen: const Menu(initialScreen: 2,), ), 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,), + }, ); } } \ No newline at end of file