2024-02-17 20:32:01 +05:30
|
|
|
import "package:auto_route/auto_route.dart";
|
|
|
|
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
|
|
|
|
|
2026-09-26 22:45:38 +03:00
|
|
|
import "package:smol_mail/presentation/routes/home_guard.dart";
|
|
|
|
|
import "package:smol_mail/presentation/routes/identity_guard.dart";
|
2024-02-17 20:32:01 +05:30
|
|
|
import "app_router.gr.dart";
|
|
|
|
|
|
|
|
|
|
@AutoRouterConfig(replaceInRouteName: "Screen,Route")
|
2026-09-26 22:45:38 +03:00
|
|
|
class AppRouter extends RootStackRouter {
|
2024-02-17 20:32:01 +05:30
|
|
|
final WidgetRef ref;
|
|
|
|
|
|
|
|
|
|
AppRouter(this.ref);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
List<AutoRoute> get routes => [
|
|
|
|
|
AutoRoute(
|
2026-09-26 22:45:38 +03:00
|
|
|
page: OnboardingRoute.page,
|
2024-02-17 20:32:01 +05:30
|
|
|
path: "/",
|
|
|
|
|
initial: true,
|
2026-09-26 22:45:38 +03:00
|
|
|
guards: [HomeGuard(ref)],
|
2024-02-17 20:32:01 +05:30
|
|
|
),
|
|
|
|
|
AutoRoute(
|
|
|
|
|
page: InboxRoute.page,
|
|
|
|
|
path: "/inbox",
|
2026-09-26 22:45:38 +03:00
|
|
|
guards: [IdentityGuard(ref)],
|
2024-02-17 20:32:01 +05:30
|
|
|
),
|
|
|
|
|
AutoRoute(
|
|
|
|
|
page: MessageDetailRoute.page,
|
|
|
|
|
path: "/message",
|
2026-09-26 22:45:38 +03:00
|
|
|
guards: [IdentityGuard(ref)],
|
|
|
|
|
),
|
|
|
|
|
AutoRoute(
|
|
|
|
|
page: ComposeRoute.page,
|
|
|
|
|
path: "/compose",
|
|
|
|
|
guards: [IdentityGuard(ref)],
|
|
|
|
|
),
|
|
|
|
|
AutoRoute(
|
|
|
|
|
page: ContactsRoute.page,
|
|
|
|
|
path: "/contacts",
|
|
|
|
|
guards: [IdentityGuard(ref)],
|
|
|
|
|
),
|
|
|
|
|
AutoRoute(
|
|
|
|
|
page: ContactDetailRoute.page,
|
|
|
|
|
path: "/contact",
|
|
|
|
|
guards: [IdentityGuard(ref)],
|
|
|
|
|
),
|
|
|
|
|
AutoRoute(
|
|
|
|
|
page: SettingsRoute.page,
|
|
|
|
|
path: "/settings",
|
|
|
|
|
guards: [IdentityGuard(ref)],
|
|
|
|
|
),
|
2024-02-17 20:32:01 +05:30
|
|
|
];
|
|
|
|
|
}
|