Initial commit
This commit is contained in:
27
lib/core/router/app_routes.dart
Normal file
27
lib/core/router/app_routes.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:food_delivery_client/feature/home/presentation/pages/categories_page/categories_page.dart';
|
||||
import 'package:food_delivery_client/feature/on_boarding/presentation/pages/splash_page/splash_page.dart';
|
||||
|
||||
import '../../food_delivery_client.dart';
|
||||
|
||||
final GlobalKey<NavigatorState> navigatorKey = GlobalKey();
|
||||
|
||||
@singleton
|
||||
class AppRoutes {
|
||||
final GoRouter router = GoRouter(
|
||||
navigatorKey: navigatorKey,
|
||||
initialLocation: Routes.splash,
|
||||
|
||||
routes: [
|
||||
GoRoute(path: Routes.splash, builder: (context, state) => SplashPage()),
|
||||
GoRoute(
|
||||
path: Routes.main,
|
||||
pageBuilder: (context, state) => CupertinoPage(child: MainPage()),
|
||||
),
|
||||
GoRoute(
|
||||
path: Routes.categories,
|
||||
pageBuilder: (context, state) => CupertinoPage(child: CategoriesPage()),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
8
lib/core/router/routes_name.dart
Normal file
8
lib/core/router/routes_name.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
abstract class Routes {
|
||||
static const String splash = '/splash';
|
||||
static const String login = '/login';
|
||||
static const String register = '/register';
|
||||
static const String main = '/main';
|
||||
static const String categories = '/categories';
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user