diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_cubit.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_cubit.dart index 9729a66d..3822645c 100644 --- a/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_cubit.dart +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_cubit.dart @@ -14,7 +14,6 @@ class ClientMainCubit extends Cubit implements Disposable { int newIndex = state.currentIndex; // Detect which tab is active based on the route path - // Using contains() to handle child routes and trailing slashes if (path.contains(ClientPaths.coverage)) { newIndex = 0; } else if (path.contains(ClientPaths.billing)) { @@ -27,8 +26,15 @@ class ClientMainCubit extends Cubit implements Disposable { newIndex = 4; } - if (newIndex != state.currentIndex) { - emit(state.copyWith(currentIndex: newIndex)); + final bool showBottomBar = + !path.contains(ClientPaths.completionReview) && + !path.contains(ClientPaths.awaitingApproval); + + if (newIndex != state.currentIndex || + showBottomBar != state.showBottomBar) { + emit( + state.copyWith(currentIndex: newIndex, showBottomBar: showBottomBar), + ); } } diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_state.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_state.dart index f2573616..78650cae 100644 --- a/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_state.dart +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/blocs/client_main_state.dart @@ -3,14 +3,19 @@ import 'package:equatable/equatable.dart'; class ClientMainState extends Equatable { const ClientMainState({ this.currentIndex = 2, // Default to Home + this.showBottomBar = true, }); final int currentIndex; + final bool showBottomBar; - ClientMainState copyWith({int? currentIndex}) { - return ClientMainState(currentIndex: currentIndex ?? this.currentIndex); + ClientMainState copyWith({int? currentIndex, bool? showBottomBar}) { + return ClientMainState( + currentIndex: currentIndex ?? this.currentIndex, + showBottomBar: showBottomBar ?? this.showBottomBar, + ); } @override - List get props => [currentIndex]; + List get props => [currentIndex, showBottomBar]; } diff --git a/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/client_main_page.dart b/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/client_main_page.dart index b01d1c9b..9f6bde79 100644 --- a/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/client_main_page.dart +++ b/apps/mobile/packages/features/client/client_main/lib/src/presentation/pages/client_main_page.dart @@ -24,13 +24,15 @@ class ClientMainPage extends StatelessWidget { body: const RouterOutlet(), bottomNavigationBar: BlocBuilder( builder: (BuildContext context, ClientMainState state) { + if (!state.showBottomBar) return const SizedBox.shrink(); + return ClientMainBottomBar( currentIndex: state.currentIndex, onTap: (int index) { BlocProvider.of(context).navigateToTab(index); }, ); - }, + }, ), ), );