add start/business unit
This commit is contained in:
@@ -10,6 +10,8 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:worker/features/account/presentation/pages/addresses_page.dart';
|
||||
import 'package:worker/features/account/presentation/pages/change_password_page.dart';
|
||||
import 'package:worker/features/account/presentation/pages/profile_edit_page.dart';
|
||||
import 'package:worker/features/auth/domain/entities/business_unit.dart';
|
||||
import 'package:worker/features/auth/presentation/pages/business_unit_selection_page.dart';
|
||||
import 'package:worker/features/auth/presentation/pages/login_page.dart';
|
||||
import 'package:worker/features/auth/presentation/pages/register_page.dart';
|
||||
import 'package:worker/features/cart/presentation/pages/cart_page.dart';
|
||||
@@ -62,8 +64,30 @@ class AppRouter {
|
||||
GoRoute(
|
||||
path: RouteNames.register,
|
||||
name: RouteNames.register,
|
||||
pageBuilder: (context, state) =>
|
||||
MaterialPage(key: state.pageKey, child: const RegisterPage()),
|
||||
pageBuilder: (context, state) {
|
||||
final extra = state.extra as Map<String, dynamic>?;
|
||||
return MaterialPage(
|
||||
key: state.pageKey,
|
||||
child: RegisterPage(
|
||||
selectedBusinessUnit: extra?['businessUnit'] as BusinessUnit?,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: RouteNames.businessUnitSelection,
|
||||
name: RouteNames.businessUnitSelection,
|
||||
pageBuilder: (context, state) {
|
||||
final extra = state.extra as Map<String, dynamic>?;
|
||||
return MaterialPage(
|
||||
key: state.pageKey,
|
||||
child: BusinessUnitSelectionPage(
|
||||
businessUnits: extra?['businessUnits'] as List<BusinessUnit>?,
|
||||
isRegistrationFlow:
|
||||
(extra?['isRegistrationFlow'] as bool?) ?? false,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
// Main Route (with bottom navigation)
|
||||
@@ -447,6 +471,7 @@ class RouteNames {
|
||||
static const String login = '/login';
|
||||
static const String otpVerification = '/otp-verification';
|
||||
static const String register = '/register';
|
||||
static const String businessUnitSelection = '/business-unit-selection';
|
||||
}
|
||||
|
||||
/// Route Extensions
|
||||
|
||||
Reference in New Issue
Block a user