refactor: reload billing data and update awaiting approval navigation to be awaitable.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user