refactor: reload billing data and update awaiting approval navigation to be awaitable.

This commit is contained in:
Achintha Isuru
2026-02-28 17:31:57 -05:00
parent 53b612851c
commit 26c4327ec5
3 changed files with 5 additions and 3 deletions

View File

@@ -102,8 +102,8 @@ extension ClientNavigator on IModularNavigator {
}
/// Navigates to the full list of invoices awaiting approval.
void toAwaitingApproval({Object? arguments}) {
safePush(ClientPaths.awaitingApproval, arguments: arguments);
Future<Object?> toAwaitingApproval({Object? arguments}) {
return safePush(ClientPaths.awaitingApproval, arguments: arguments);
}
/// Navigates to the Invoice Ready page.

View File

@@ -49,7 +49,6 @@ class _ShiftCompletionReviewPageState extends State<ShiftCompletionReviewPage> {
title: invoice.title,
subtitle: invoice.clientName,
showBackButton: true,
onLeadingPressed: () => Modular.to.toAwaitingApproval(),
),
body: SafeArea(
child: SingleChildScrollView(

View File

@@ -8,6 +8,8 @@ import 'package:krow_core/core.dart';
import '../../blocs/shift_completion_review/shift_completion_review_bloc.dart';
import '../../blocs/shift_completion_review/shift_completion_review_event.dart';
import '../../blocs/shift_completion_review/shift_completion_review_state.dart';
import '../../blocs/billing_bloc.dart';
import '../../blocs/billing_event.dart';
class CompletionReviewActions extends StatelessWidget {
const CompletionReviewActions({required this.invoiceId, super.key});
@@ -30,6 +32,7 @@ class CompletionReviewActions extends StatelessWidget {
: UiSnackbarType.warning;
UiSnackbar.show(context, message: message, type: type);
Modular.get<BillingBloc>().add(const BillingLoadStarted());
Modular.to.toAwaitingApproval();
} else if (state.status == ShiftCompletionReviewStatus.failure) {
UiSnackbar.show(