# Conflicts: # apps/mobile_app/lib/navigation/app_router.dart # apps/mobile_app/pubspec.yaml # modules/auth/lib/src/device_sign_up/add_kid_screen.dart # modules/auth/lib/src/login/presentation/link_phone_screen.dart # modules/auth/lib/src/login/presentation/login_screen.dart # modules/auth/lib/src/login/presentation/phone_code_screen.dart # modules/auth/lib/src/onboarding/presentation/welcome_screen.dart # modules/auth/lib/src/recover_password/presentation/new_password_screen.dart # modules/auth/lib/src/sign_up/signup_screen.dart # modules/home/lib/src/presentation/deposit_screen.dart # modules/home/lib/src/presentation/home_screen.dart # modules/home/lib/src/presentation/wage_screen.dart # modules/notifications/lib/src/core/activity_list.dart # packages/design_system/lib/design_system.dart
104 lines
2.9 KiB
Dart
104 lines
2.9 KiB
Dart
import 'package:auth/auth.dart';
|
|
import 'package:dashboard_shell/dashboard_builder.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get_it/get_it.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:home/home.dart';
|
|
import 'package:navigation/navigation.dart';
|
|
import 'package:notifications/notifications.dart';
|
|
import 'package:profile/profile.dart';
|
|
|
|
final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
late final GoRouter appRouter;
|
|
|
|
void configureAppRouter() {
|
|
appRouter = GoRouter(
|
|
navigatorKey: rootNavigatorKey,
|
|
initialLocation: AppRoutes.login,
|
|
debugLogDiagnostics: true,
|
|
routes: [
|
|
GoRoute(
|
|
path: AppRoutes.login,
|
|
name: 'login',
|
|
pageBuilder: LoginBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: AppRoutes.signup,
|
|
name: 'signup',
|
|
pageBuilder: SignupBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: AppRoutes.onboarding,
|
|
name: 'onboarding',
|
|
pageBuilder: OnboardingBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: AppRoutes.linkPhone,
|
|
name: 'link_phone',
|
|
pageBuilder: LinkPhoneBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: AppRoutes.phoneCode,
|
|
name: 'phone_code',
|
|
pageBuilder: PhoneCodeBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: AppRoutes.recoverPassword,
|
|
name: 'recover_password',
|
|
pageBuilder: RecoverPasswordBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: AppRoutes.deviceSignup,
|
|
name: 'device_signup',
|
|
pageBuilder: DeviceSignupBuilder().buildPage,
|
|
),
|
|
StatefulShellRoute.indexedStack(
|
|
builder: (context, state, navShell) {
|
|
return DashboardBuilder().build(context, navShell);
|
|
},
|
|
branches: [
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: AppRoutes.dashboardHome,
|
|
name: 'home',
|
|
pageBuilder: const HomeBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: AppRoutes.dashboardActivity,
|
|
name: 'activity',
|
|
pageBuilder: const ActivityBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: AppRoutes.dashboardNotifications,
|
|
name: 'notifications',
|
|
pageBuilder: const NotificationsBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: AppRoutes.dashboardProfile,
|
|
name: 'profile',
|
|
pageBuilder: const ProfileBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
|
|
GetIt.I<NavigationContract>().setRouter(appRouter);
|
|
}
|