how to make a persistent bottom navigation bar visible across the app flutter with autoroute ? (flutter)

Viewed 21

Can someone please tell me how to make my bottom navigation bar persistent in my app with auto_route ? I tried to find something in the official documentation, but unfortunately nothing.

Here is my AppRouter code:

@MaterialAutoRouter(replaceInRouteName: 'Page|Screen,Route', routes: <AutoRoute>[
  AutoRoute<String>(path: '/', page: HomePage, guards: [
    AuthGuard
  ], children: [
    AutoRoute(path: '', page: ItemListPage, name: 'ItemListRoute', initial: true),
    AutoRoute(
      path: 'messages',
      page: ListOfConversationsScreen,
      name: 'ConversationsRoute',
    ),
    AutoRoute(
      path: 'settings',
      page: SettingsScreen,
      name: 'SettingsRoute',
    ),
    AutoRoute(
      maintainState: false,
      path: 'selectNgo',
      page: NgoSelectorScreen,
    ),
    AutoRoute(
      path: 'ourPartners',
      page: PartnersScreen,
      name: 'OurPartnersRoute',
    ),
  ]),
  AutoRoute(path: '/login', page: LoginScreen),
  AutoRoute(
    path: '/donate/:itemId/:conversationId',
    page: DonateScreen,
    name: 'DonateRoute',
    guards: [AuthGuard],
  ),
  AutoRoute(
    path: '/donationSuccessful/:itemId/:conversationId',
    page: DonationSuccessfulScreen,
    name: 'DonationSuccessfulRoute',
    guards: [AuthGuard],
  ),
  AutoRoute(
    path: '/messages/:conversation_id',
    page: ConversationScreen,
    name: 'MessagesRoute',
    guards: [AuthGuard],
  ),
  AutoRoute(
    path: '/item/:itemId',
    page: ItemDetailsScreen,
    name: 'ItemDetailsRoute',
    guards: [AuthGuard],
  ),
])

class AppRouter extends _$AppRouter {
  final AuthGuard authGuard;

  AppRouter({required this.authGuard}) : super(authGuard: authGuard);
}

Thank you in advance!

0 Answers
Related