[stacked_services] 0.8.3 currentRoute doesn't work for nested routes
Relevant to #218, currentRoute still doesn't work as expected for nested routes.
Having routes such as:
MaterialRoute(page: LoginView, initial: true),
MaterialRoute(
page: DrawerNavigatorView,
children: [
CustomRoute(page: HomeView, initial: true),
CustomRoute(page: ReportsView),
CustomRoute(page: TeamView),
CustomRoute(page: SettingsView),
CustomRoute(page: SupportView),
],
),
When on one of the nested routes, e.g. HomeView, ReportsView, TeamView the currentRoute is always /drawer-navigator-view. In our case at least it would be desired to get information about the current nested route as well.
Please try passing StackedService.routeObserver into your ExtendedNavigator 's observers
@hurbes I'm not really sure what you mean, use it somewhere other than the MaterialApp?
You are using ExtendedNavigator for those nested routes, right? Try passing the StackedService.routeObserver in its observers like this
ExtendedNavigator<HomeViewRouter>(
router: HomeViewRouter(),
initialRoute: Routes.streamCounterView,
observers: [StackedService.routeObserver],
navigatorKey: StackedService.nestedNavigationKey(1),
);
Ah yes, that works. Thank you