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.
|
/// Navigates to the full list of invoices awaiting approval.
|
||||||
void toAwaitingApproval({Object? arguments}) {
|
Future<Object?> toAwaitingApproval({Object? arguments}) {
|
||||||
safePush(ClientPaths.awaitingApproval, arguments: arguments);
|
return safePush(ClientPaths.awaitingApproval, arguments: arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Navigates to the Invoice Ready page.
|
/// Navigates to the Invoice Ready page.
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ class _ShiftCompletionReviewPageState extends State<ShiftCompletionReviewPage> {
|
|||||||
title: invoice.title,
|
title: invoice.title,
|
||||||
subtitle: invoice.clientName,
|
subtitle: invoice.clientName,
|
||||||
showBackButton: true,
|
showBackButton: true,
|
||||||
onLeadingPressed: () => Modular.to.toAwaitingApproval(),
|
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
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_bloc.dart';
|
||||||
import '../../blocs/shift_completion_review/shift_completion_review_event.dart';
|
import '../../blocs/shift_completion_review/shift_completion_review_event.dart';
|
||||||
import '../../blocs/shift_completion_review/shift_completion_review_state.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 {
|
class CompletionReviewActions extends StatelessWidget {
|
||||||
const CompletionReviewActions({required this.invoiceId, super.key});
|
const CompletionReviewActions({required this.invoiceId, super.key});
|
||||||
@@ -30,6 +32,7 @@ class CompletionReviewActions extends StatelessWidget {
|
|||||||
: UiSnackbarType.warning;
|
: UiSnackbarType.warning;
|
||||||
|
|
||||||
UiSnackbar.show(context, message: message, type: type);
|
UiSnackbar.show(context, message: message, type: type);
|
||||||
|
Modular.get<BillingBloc>().add(const BillingLoadStarted());
|
||||||
Modular.to.toAwaitingApproval();
|
Modular.to.toAwaitingApproval();
|
||||||
} else if (state.status == ShiftCompletionReviewStatus.failure) {
|
} else if (state.status == ShiftCompletionReviewStatus.failure) {
|
||||||
UiSnackbar.show(
|
UiSnackbar.show(
|
||||||
|
|||||||
Reference in New Issue
Block a user