feat: implement child route management for client and staff modules; enhance routing structure for better navigation
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:client_home/client_home.dart';
|
||||
import 'package:client_coverage/client_coverage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import 'package:view_orders/view_orders.dart';
|
||||
|
||||
import 'presentation/blocs/client_main_cubit.dart';
|
||||
@@ -21,12 +22,24 @@ class ClientMainModule extends Module {
|
||||
'/',
|
||||
child: (BuildContext context) => const ClientMainPage(),
|
||||
children: <ParallelRoute<dynamic>>[
|
||||
ModuleRoute<dynamic>('/home', module: ClientHomeModule()),
|
||||
ModuleRoute<dynamic>('/coverage', module: CoverageModule()),
|
||||
ModuleRoute<dynamic>('/billing', module: BillingModule()),
|
||||
ModuleRoute<dynamic>('/orders', module: ViewOrdersModule()),
|
||||
ModuleRoute<dynamic>(
|
||||
ClientPaths.childRoute(ClientPaths.main, ClientPaths.home),
|
||||
module: ClientHomeModule(),
|
||||
),
|
||||
ModuleRoute<dynamic>(
|
||||
ClientPaths.childRoute(ClientPaths.main, ClientPaths.coverage),
|
||||
module: CoverageModule(),
|
||||
),
|
||||
ModuleRoute<dynamic>(
|
||||
ClientPaths.childRoute(ClientPaths.main, ClientPaths.billing),
|
||||
module: BillingModule(),
|
||||
),
|
||||
ModuleRoute<dynamic>(
|
||||
ClientPaths.childRoute(ClientPaths.main, ClientPaths.orders),
|
||||
module: ViewOrdersModule(),
|
||||
),
|
||||
ChildRoute<dynamic>(
|
||||
'/reports',
|
||||
ClientPaths.childRoute(ClientPaths.main, ClientPaths.reports),
|
||||
child: (BuildContext context) =>
|
||||
const PlaceholderPage(title: 'Reports'),
|
||||
),
|
||||
|
||||
@@ -21,7 +21,7 @@ class ClientMainCubit extends Cubit<ClientMainState> implements Disposable {
|
||||
newIndex = 1;
|
||||
} else if (path.contains(ClientPaths.home)) {
|
||||
newIndex = 2;
|
||||
} else if (path.contains(ClientPaths.viewOrders)) {
|
||||
} else if (path.contains(ClientPaths.orders)) {
|
||||
newIndex = 3;
|
||||
} else if (path.contains(ClientPaths.reports)) {
|
||||
newIndex = 4;
|
||||
@@ -46,7 +46,7 @@ class ClientMainCubit extends Cubit<ClientMainState> implements Disposable {
|
||||
Modular.to.navigate(ClientPaths.home);
|
||||
break;
|
||||
case 3:
|
||||
Modular.to.navigate(ClientPaths.viewOrders);
|
||||
Modular.to.navigate(ClientPaths.orders);
|
||||
break;
|
||||
case 4:
|
||||
Modular.to.navigate(ClientPaths.reports);
|
||||
|
||||
Reference in New Issue
Block a user