feat: address missing features and bugs identified during Milestone 3 demo; improve localization, error handling, and navigation
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
library;
|
||||
|
||||
export 'src/client_main_module.dart';
|
||||
export 'src/presentation/navigation/client_main_navigator.dart';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'client_main_state.dart';
|
||||
|
||||
class ClientMainCubit extends Cubit<ClientMainState> implements Disposable {
|
||||
@@ -14,15 +15,15 @@ class ClientMainCubit extends Cubit<ClientMainState> implements Disposable {
|
||||
|
||||
// Detect which tab is active based on the route path
|
||||
// Using contains() to handle child routes and trailing slashes
|
||||
if (path.contains('/client-main/coverage')) {
|
||||
if (path.contains(ClientPaths.coverage)) {
|
||||
newIndex = 0;
|
||||
} else if (path.contains('/client-main/billing')) {
|
||||
} else if (path.contains(ClientPaths.billing)) {
|
||||
newIndex = 1;
|
||||
} else if (path.contains('/client-main/home')) {
|
||||
} else if (path.contains(ClientPaths.home)) {
|
||||
newIndex = 2;
|
||||
} else if (path.contains('/client-main/orders')) {
|
||||
} else if (path.contains(ClientPaths.viewOrders)) {
|
||||
newIndex = 3;
|
||||
} else if (path.contains('/client-main/reports')) {
|
||||
} else if (path.contains(ClientPaths.reports)) {
|
||||
newIndex = 4;
|
||||
}
|
||||
|
||||
@@ -36,19 +37,19 @@ class ClientMainCubit extends Cubit<ClientMainState> implements Disposable {
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
Modular.to.navigate('/client-main/coverage');
|
||||
Modular.to.navigate(ClientPaths.coverage);
|
||||
break;
|
||||
case 1:
|
||||
Modular.to.navigate('/client-main/billing');
|
||||
Modular.to.navigate(ClientPaths.billing);
|
||||
break;
|
||||
case 2:
|
||||
Modular.to.navigate('/client-main/home');
|
||||
Modular.to.navigate(ClientPaths.home);
|
||||
break;
|
||||
case 3:
|
||||
Modular.to.navigate('/client-main/orders');
|
||||
Modular.to.navigate(ClientPaths.viewOrders);
|
||||
break;
|
||||
case 4:
|
||||
Modular.to.navigate('/client-main/reports');
|
||||
Modular.to.navigate(ClientPaths.reports);
|
||||
break;
|
||||
}
|
||||
// State update will happen via _onRouteChanged
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// Extension to provide typed navigation for the Client Main feature.
|
||||
extension ClientMainNavigator on IModularNavigator {
|
||||
/// Navigates to the Client Main Shell (Home).
|
||||
/// This replaces the current navigation stack.
|
||||
void navigateClientMain() {
|
||||
navigate('/client-main/');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user