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,10 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// Extension on [IModularNavigator] to provide strongly-typed navigation
|
||||
/// for the staff certificates feature.
|
||||
extension CertificatesNavigator on IModularNavigator {
|
||||
/// Navigates back.
|
||||
void popCertificates() {
|
||||
pop();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
library staff_certificates;
|
||||
|
||||
export 'src/staff_certificates_module.dart';
|
||||
export 'src/presentation/navigation/certificates_navigator.dart'; // Export navigator extension
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// Extension on [IModularNavigator] to provide strongly-typed navigation
|
||||
/// for the staff documents feature.
|
||||
extension DocumentsNavigator on IModularNavigator {
|
||||
/// Navigates to the document upload/view page.
|
||||
/// [documentId] is the ID of the document to view or upload.
|
||||
void pushDocumentDetails(String documentId) {
|
||||
pushNamed('./details', arguments: documentId);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import 'package:core_localization/core_localization.dart';
|
||||
|
||||
import '../blocs/documents/documents_cubit.dart';
|
||||
import '../blocs/documents/documents_state.dart';
|
||||
import '../navigation/documents_navigator.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import '../widgets/document_card.dart';
|
||||
import '../widgets/documents_progress_card.dart';
|
||||
|
||||
@@ -81,7 +81,7 @@ class DocumentsPage extends StatelessWidget {
|
||||
...state.documents.map(
|
||||
(StaffDocument doc) => DocumentCard(
|
||||
document: doc,
|
||||
onTap: () => Modular.to.pushDocumentDetails(doc.id),
|
||||
onTap: () => Modular.to.pushNamed('./details', arguments: doc.id),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
extension StaffBankAccountNavigator on IModularNavigator {
|
||||
void popPage() {
|
||||
pop();
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
import '../blocs/bank_account_cubit.dart';
|
||||
import '../blocs/bank_account_state.dart';
|
||||
import '../navigation/staff_bank_account_navigator.dart';
|
||||
import 'package:krow_core/core.dart';
|
||||
import '../widgets/add_account_form.dart';
|
||||
|
||||
class BankAccountPage extends StatelessWidget {
|
||||
@@ -33,7 +33,7 @@ class BankAccountPage extends StatelessWidget {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(UiIcons.arrowLeft, color: UiColors.textSecondary),
|
||||
onPressed: () => Modular.to.popPage(),
|
||||
onPressed: () => Modular.to.pop(),
|
||||
),
|
||||
title: Text(
|
||||
strings.title,
|
||||
@@ -118,10 +118,10 @@ class BankAccountPage extends StatelessWidget {
|
||||
accountNumber: account,
|
||||
type: type,
|
||||
);
|
||||
Modular.to.popPage();
|
||||
Modular.to.pop();
|
||||
},
|
||||
onCancel: () {
|
||||
Modular.to.popPage();
|
||||
Modular.to.pop();
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// Extension on [IModularNavigator] to provide strongly-typed navigation
|
||||
/// for the staff attire feature.
|
||||
extension AttireNavigator on IModularNavigator {
|
||||
/// Navigates back.
|
||||
void popAttire() {
|
||||
pop();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
extension ExperienceNavigator on IModularNavigator {
|
||||
// Add navigation methods here if the page navigates deeper.
|
||||
// Currently ExperiencePage is a leaf, but might need to navigate back or to success screen.
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// Typed navigation extensions for the Staff Profile Info feature.
|
||||
///
|
||||
/// Provides type-safe navigation methods to avoid magic strings
|
||||
/// throughout the codebase.
|
||||
extension ProfileInfoNavigator on IModularNavigator {
|
||||
/// Navigates to the Personal Info page.
|
||||
///
|
||||
/// This page allows staff members to edit their personal information
|
||||
/// including phone, bio, languages, and preferred locations.
|
||||
Future<void> pushPersonalInfo() {
|
||||
return pushNamed('./personal-info');
|
||||
}
|
||||
|
||||
/// Navigates to the Emergency Contact page.
|
||||
///
|
||||
/// TODO: Implement when emergency contact page is created.
|
||||
Future<void> pushEmergencyContact() {
|
||||
return pushNamed('/profile/onboarding/emergency-contact');
|
||||
}
|
||||
|
||||
/// Navigates to the Experience page.
|
||||
///
|
||||
/// TODO: Implement when experience page is created.
|
||||
Future<void> pushExperience() {
|
||||
return pushNamed('/profile/onboarding/experience');
|
||||
}
|
||||
|
||||
/// Navigates to the Attire page.
|
||||
///
|
||||
/// TODO: Implement when attire page is created.
|
||||
Future<void> pushAttire() {
|
||||
return pushNamed('/profile/onboarding/attire');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
/// Typed navigation extensions for the Staff Profile Info feature.
|
||||
///
|
||||
/// Provides type-safe navigation methods to avoid magic strings
|
||||
/// throughout the codebase.
|
||||
extension ProfileInfoNavigator on IModularNavigator {
|
||||
/// Navigates to the Personal Info page.
|
||||
///
|
||||
/// This page allows staff members to edit their personal information
|
||||
/// including phone, bio, languages, and preferred locations.
|
||||
Future<void> pushPersonalInfo() {
|
||||
return pushNamed('./personal-info');
|
||||
}
|
||||
|
||||
/// Navigates to the Emergency Contact page.
|
||||
///
|
||||
/// TODO: Implement when emergency contact page is created.
|
||||
Future<void> pushEmergencyContact() {
|
||||
return pushNamed('/profile/onboarding/emergency-contact');
|
||||
}
|
||||
|
||||
/// Navigates to the Experience page.
|
||||
///
|
||||
/// TODO: Implement when experience page is created.
|
||||
Future<void> pushExperience() {
|
||||
return pushNamed('/profile/onboarding/experience');
|
||||
}
|
||||
|
||||
/// Navigates to the Attire page.
|
||||
///
|
||||
/// TODO: Implement when attire page is created.
|
||||
Future<void> pushAttire() {
|
||||
return pushNamed('/profile/onboarding/attire');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user