- created wallet balance block, wallet item and kid line chart widgets. - restructured onboarding, signup and device signup screens into layouts and main screens. - updated signup and kid wallet screens to 17/11 design.
100 lines
2.7 KiB
Dart
100 lines
2.7 KiB
Dart
import 'package:auth/auth.dart';
|
|
import 'package:dashboard_shell/dashboard_builder.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:home/home.dart';
|
|
|
|
import 'package:navigation/navigation.dart';
|
|
import 'package:get_it/get_it.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: '/onboarding',
|
|
// redirect: (context, state) {},
|
|
routes: [
|
|
GoRoute(
|
|
path: '/login',
|
|
name: 'login',
|
|
pageBuilder: LoginBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: '/onboarding',
|
|
name: 'onboarding',
|
|
pageBuilder: OnboardingBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: '/link_phone',
|
|
name: 'link_phone',
|
|
pageBuilder: LinkPhoneBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: '/phone_code',
|
|
name: 'phone_code',
|
|
pageBuilder: PhoneCodeBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: '/recover_password',
|
|
name: 'recover_password',
|
|
pageBuilder: RecoverPasswordBuilder().buildPage,
|
|
),
|
|
GoRoute(
|
|
path: '/device_signup',
|
|
name: 'device_signup',
|
|
pageBuilder: DeviceSignupBuilder().buildPage,
|
|
),
|
|
StatefulShellRoute.indexedStack(
|
|
builder: (context, state, navShell) {
|
|
return DashboardBuilder().build(context, navShell);
|
|
},
|
|
branches: [
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: '/main/home',
|
|
name: 'home',
|
|
pageBuilder: const HomeBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: '/main/activity',
|
|
name: 'activity',
|
|
pageBuilder: const ActivityBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: '/main/notifications',
|
|
name: 'notifications',
|
|
pageBuilder: const NotificationsBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
StatefulShellBranch(
|
|
routes: [
|
|
GoRoute(
|
|
path: '/main/profile',
|
|
name: 'profile',
|
|
pageBuilder: const ProfileBuilder().buildPage,
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
|
|
GetIt.I<NavigationContract>().setRouter(appRouter);
|
|
}
|