routemaster
routemaster copied to clipboard
How to pop to Tabbar Index 0
I´ve got the following route map `return RouteMap(
routes: {
'/': (_) => TabPage(
child: PageviewPage(userId: userId),
paths: const [
'/home',
'/notifications',
'/create',
'/chat',
'/settings',
],
backBehavior: TabBackBehavior.none,
),
'/home': (_) => const MaterialPage(
name: 'Home',
child: HomeTab(),
),
'/notifications': (_) => const MaterialPage(
name: 'Notifications',
child: NotificationsTab(),
),
'/create': (_) => const MaterialPage(
name: 'Create',
child: CreateTab(),
),
'/create/create1': (_) => const MaterialPage(
name: 'CreateEventPage1',
child: CreateEventPage1(),
),
'/create/create1/create2': (_) => const MaterialPage(
name: 'CreateEventPage2',
child: CreateEventPage2(),
),
'/chat': (_) => const MaterialPage(
name: 'Chat',
child: ChatTab(),
),
'/settings': (_) => const MaterialPage(
name: 'Settings',
child: SettingsTab(),
),
},
);`
Let´s imagine I pushed to create/create1/create2
. In create2 I want to replace the whole page stack with /home
. Is that possible? When I try Routemaster.of(context).replace('/');
I get back to /create
. When I try Routemaster.of(context).replace('/home');
I get to /home
but the whole stack in /create
is still there.