Refactor navigation and remove unused navigator extensions across staff features
- Removed background color from CreateOrderView, OneTimeOrderView, and RapidOrderView. - Updated navigation paths in OneTimeOrderView and other staff authentication pages to use new constants. - Deleted unused navigator extensions for staff authentication, home, profile, and shifts. - Refactored navigation in StaffMainModule to use new path constants. - Cleaned up imports and adjusted navigation calls in various staff-related pages and widgets.
This commit is contained in:
@@ -1,88 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// Extension on [IModularNavigator] providing typed navigation helpers
|
||||
/// for the Staff Profile feature.
|
||||
///
|
||||
/// These methods provide a type-safe way to navigate to various profile-related
|
||||
/// pages without relying on string literals throughout the codebase.
|
||||
extension ProfileNavigator on IModularNavigator {
|
||||
/// Navigates to the personal info page.
|
||||
void pushPersonalInfo() {
|
||||
pushNamed('../onboarding/personal-info');
|
||||
}
|
||||
|
||||
/// Navigates to the emergency contact page.
|
||||
void pushEmergencyContact() {
|
||||
pushNamed('../emergency-contact');
|
||||
}
|
||||
|
||||
/// Navigates to the experience page.
|
||||
void pushExperience() {
|
||||
pushNamed('../experience');
|
||||
}
|
||||
|
||||
/// Navigates to the attire page.
|
||||
void pushAttire() {
|
||||
pushNamed('../attire');
|
||||
}
|
||||
|
||||
/// Navigates to the documents page.
|
||||
void pushDocuments() {
|
||||
pushNamed('../documents');
|
||||
}
|
||||
|
||||
/// Navigates to the certificates page.
|
||||
void pushCertificates() {
|
||||
pushNamed('/certificates');
|
||||
}
|
||||
|
||||
/// Navigates to the tax forms page.
|
||||
void pushTaxForms() {
|
||||
pushNamed('../tax-forms/');
|
||||
}
|
||||
|
||||
/// Navigates to Krow University.
|
||||
void pushKrowUniversity() {
|
||||
pushNamed('/krow-university');
|
||||
}
|
||||
|
||||
/// Navigates to the trainings page.
|
||||
void pushTrainings() {
|
||||
pushNamed('/trainings');
|
||||
}
|
||||
|
||||
/// Navigates to the leaderboard page.
|
||||
void pushLeaderboard() {
|
||||
pushNamed('/leaderboard');
|
||||
}
|
||||
|
||||
/// Navigates to the bank account page.
|
||||
void pushBankAccount() {
|
||||
pushNamed('../bank-account/');
|
||||
}
|
||||
|
||||
/// Navigates to the timecard page.
|
||||
void pushTimecard() {
|
||||
pushNamed('../time-card');
|
||||
}
|
||||
|
||||
/// Navigates to the FAQs page.
|
||||
void pushFaqs() {
|
||||
pushNamed('/faqs');
|
||||
}
|
||||
|
||||
/// Navigates to the privacy & security page.
|
||||
void pushPrivacy() {
|
||||
pushNamed('/privacy');
|
||||
}
|
||||
|
||||
/// Navigates to the messages page.
|
||||
void pushMessages() {
|
||||
pushNamed('/messages');
|
||||
}
|
||||
|
||||
/// Navigates to the get started/authentication screen.
|
||||
void navigateToGetStarted() {
|
||||
navigate('/');
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
import '../blocs/profile_cubit.dart';
|
||||
import '../blocs/profile_state.dart';
|
||||
import '../navigation/profile_navigator.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import '../widgets/logout_button.dart';
|
||||
import '../widgets/profile_menu_grid.dart';
|
||||
import '../widgets/profile_menu_item.dart';
|
||||
@@ -61,7 +61,7 @@ class StaffProfilePage extends StatelessWidget {
|
||||
bloc: cubit,
|
||||
listener: (context, state) {
|
||||
if (state.status == ProfileStatus.signedOut) {
|
||||
Modular.to.navigateToGetStarted();
|
||||
Modular.to.toGetStarted();
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
@@ -124,17 +124,17 @@ class StaffProfilePage extends StatelessWidget {
|
||||
ProfileMenuItem(
|
||||
icon: UiIcons.user,
|
||||
label: i18n.menu_items.personal_info,
|
||||
onTap: () => Modular.to.pushPersonalInfo(),
|
||||
onTap: () => Modular.to.toPersonalInfo(),
|
||||
),
|
||||
ProfileMenuItem(
|
||||
icon: UiIcons.phone,
|
||||
label: i18n.menu_items.emergency_contact,
|
||||
onTap: () => Modular.to.pushEmergencyContact(),
|
||||
onTap: () => Modular.to.toEmergencyContact(),
|
||||
),
|
||||
ProfileMenuItem(
|
||||
icon: UiIcons.briefcase,
|
||||
label: i18n.menu_items.experience,
|
||||
onTap: () => Modular.to.pushExperience(),
|
||||
onTap: () => Modular.to.toExperience(),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -149,7 +149,7 @@ class StaffProfilePage extends StatelessWidget {
|
||||
ProfileMenuItem(
|
||||
icon: UiIcons.file,
|
||||
label: i18n.menu_items.tax_forms,
|
||||
onTap: () => Modular.to.pushTaxForms(),
|
||||
onTap: () => Modular.to.toTaxForms(),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -163,17 +163,17 @@ class StaffProfilePage extends StatelessWidget {
|
||||
ProfileMenuItem(
|
||||
icon: UiIcons.building,
|
||||
label: i18n.menu_items.bank_account,
|
||||
onTap: () => Modular.to.pushBankAccount(),
|
||||
onTap: () => Modular.to.toBankAccount(),
|
||||
),
|
||||
ProfileMenuItem(
|
||||
icon: UiIcons.creditCard,
|
||||
label: i18n.menu_items.payments,
|
||||
onTap: () => Modular.to.navigate('/worker-main/payments'),
|
||||
onTap: () => Modular.to.toPayments(),
|
||||
),
|
||||
ProfileMenuItem(
|
||||
icon: UiIcons.clock,
|
||||
label: i18n.menu_items.timecard,
|
||||
onTap: () => Modular.to.pushTimecard(),
|
||||
onTap: () => Modular.to.toTimeCard(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user