feat: Add post-save navigation to staff profile for emergency contact and experience, remove a placeholder page, and refine bloc usage and UI rendering.

This commit is contained in:
Achintha Isuru
2026-02-22 03:01:44 -05:00
parent 214e0d1237
commit a9ead783e4
8 changed files with 149 additions and 126 deletions

View File

@@ -29,7 +29,7 @@ extension StaffNavigator on IModularNavigator {
// ==========================================================================
/// Navigates to the root get started/authentication screen.
///
///
/// This effectively logs out the user by navigating to root.
/// Used when signing out or session expires.
void toInitialPage() {
@@ -37,7 +37,7 @@ extension StaffNavigator on IModularNavigator {
}
/// Navigates to the get started page.
///
///
/// This is the landing page for unauthenticated users, offering login/signup options.
void toGetStartedPage() {
navigate(StaffPaths.getStarted);
@@ -64,7 +64,7 @@ extension StaffNavigator on IModularNavigator {
/// This is typically called after successful phone verification for new
/// staff members. Uses pushReplacement to prevent going back to verification.
void toProfileSetup() {
pushReplacementNamed(StaffPaths.profileSetup);
pushNamed(StaffPaths.profileSetup);
}
// ==========================================================================
@@ -76,7 +76,7 @@ extension StaffNavigator on IModularNavigator {
/// This is the main landing page for authenticated staff members.
/// Displays shift cards, quick actions, and notifications.
void toStaffHome() {
pushNamed(StaffPaths.home);
pushNamedAndRemoveUntil(StaffPaths.home, (_) => false);
}
/// Navigates to the staff main shell.
@@ -84,7 +84,7 @@ extension StaffNavigator on IModularNavigator {
/// This is the container with bottom navigation. Navigates to home tab
/// by default. Usually you'd navigate to a specific tab instead.
void toStaffMain() {
navigate('${StaffPaths.main}/home/');
pushNamedAndRemoveUntil('${StaffPaths.main}/home/', (_) => false);
}
// ==========================================================================
@@ -113,8 +113,9 @@ extension StaffNavigator on IModularNavigator {
if (refreshAvailable == true) {
args['refreshAvailable'] = true;
}
navigate(
pushNamedAndRemoveUntil(
StaffPaths.shifts,
(_) => false,
arguments: args.isEmpty ? null : args,
);
}
@@ -123,21 +124,21 @@ extension StaffNavigator on IModularNavigator {
///
/// View payment history, earnings breakdown, and tax information.
void toPayments() {
navigate(StaffPaths.payments);
pushNamedAndRemoveUntil(StaffPaths.payments, (_) => false);
}
/// Navigates to the Clock In tab.
///
/// Access time tracking interface for active shifts.
void toClockIn() {
navigate(StaffPaths.clockIn);
pushNamedAndRemoveUntil(StaffPaths.clockIn, (_) => false);
}
/// Navigates to the Profile tab.
///
/// Manage personal information, documents, and preferences.
void toProfile() {
navigate(StaffPaths.profile);
pushNamedAndRemoveUntil(StaffPaths.profile, (_) => false);
}
// ==========================================================================
@@ -155,10 +156,7 @@ extension StaffNavigator on IModularNavigator {
/// The shift object is passed as an argument and can be retrieved
/// in the details page.
void toShiftDetails(Shift shift) {
navigate(
StaffPaths.shiftDetails(shift.id),
arguments: shift,
);
navigate(StaffPaths.shiftDetails(shift.id), arguments: shift);
}
/// Pushes the shift details page (alternative method).
@@ -167,10 +165,7 @@ extension StaffNavigator on IModularNavigator {
/// Use this when you want to add the details page to the stack rather
/// than replacing the current route.
void pushShiftDetails(Shift shift) {
pushNamed(
StaffPaths.shiftDetails(shift.id),
arguments: shift,
);
pushNamed(StaffPaths.shiftDetails(shift.id), arguments: shift);
}
// ==========================================================================