Open kuyazee opened 12 months ago
Were you able to find a workaround? https://github.com/Milad-Akarie/auto_route_library/issues/1654#issuecomment-1806937070
Check out the example app, I was able to fix it by creating tab pages. Updated code
// This was the actual issue
@RoutePage(name: 'HomeTab')
class HomeTabPage extends AutoRouter {
const HomeTabPage({super.key});
}
@RoutePage(name: 'SeniorListTab')
class SeniorListTabPage extends AutoRouter {
const SeniorListTabPage({super.key});
}
@RoutePage(name: 'AnalysisListTab')
class AnalysisListTabPage extends AutoRouter {
const AnalysisListTabPage({super.key});
}
@RoutePage(name: 'MoreTab')
class MoreTabPage extends AutoRouter {
const MoreTabPage({super.key});
}
class AppRouter extends _$AppRouter {
// Private constructor
AppRouter._();
static AppRouter shared = AppRouter._();
@override
List<AutoRoute> get routes => [
AutoRoute(page: SplashRoute.page, initial: true),
AutoRoute(page: ProductGuideRoute.page),
AutoRoute(page: LoginRoute.page),
AutoRoute(
path: '/',
page: B2BDashboardRoute.page,
children: [
RedirectRoute(path: '', redirectTo: 'home'),
AutoRoute(
path: 'home',
page: HomeTab.page,
children: [
AutoRoute(path: '', page: HomeRoute.page),
],
),
AutoRoute(
path: 'seniors',
page: SeniorListTab.page,
children: [
AutoRoute(path: '', page: LinderaSeniorListRoute.page),
AutoRoute(path: 'seniorId:', page: MainProfileRoute.page),
],
),
AutoRoute(
path: 'analysis',
page: AnalysisListTab.page,
children: [
AutoRoute(path: '', page: AnalysesListRoute.page),
],
),
AutoRoute(
path: 'more',
page: MoreTab.page,
children: [
AutoRoute(path: '', page: MoreRoute.page),
],
),
],
),
];
}
As you can see in this recording, it is navigating on the wrong location for some reason
Am I doing something wrong?
https://github.com/Milad-Akarie/auto_route_library/assets/17846698/b75047ba-0b94-4001-ab69-893ae77dc52e
Here's my router setup
Application Setup
Sample Screens
Flutter Doctor
Auto Route Version: 7.8.4
Pubspec