chore: fix routes not working when initially signing in

This commit is contained in:
Kingkor Roy Tirtho 2025-02-11 20:25:34 +06:00
parent 1c56617955
commit 4ea0523692

View File

@ -15,7 +15,17 @@ class AppRouter extends RootStackRouter {
AppRouter(this.ref) : super(navigatorKey: rootNavigatorKey); AppRouter(this.ref) : super(navigatorKey: rootNavigatorKey);
@override @override
List<AutoRouteGuard> get guards => [ List<AutoRoute> get routes => [
AutoRoute(
page: RootAppRoute.page,
path: "/",
initial: true,
children: [
AutoRoute(
path: "home",
page: HomeRoute.page,
initial: true,
guards: [
AutoRouteGuardCallback( AutoRouteGuardCallback(
(resolver, router) async { (resolver, router) async {
final auth = await ref.read(authenticationProvider.future); final auth = await ref.read(authenticationProvider.future);
@ -27,19 +37,7 @@ class AppRouter extends RootStackRouter {
} }
}, },
), ),
]; ],
@override
List<AutoRoute> get routes => [
AutoRoute(
page: RootAppRoute.page,
path: "/",
initial: true,
children: [
AutoRoute(
path: "home",
page: HomeRoute.page,
initial: true,
), ),
AutoRoute( AutoRoute(
path: "home/genres", path: "home/genres",