submit method
FutureOr<bool>
submit(
- FutureOr<
bool> submission(), { - String? submissionReason,
- Iterable<
IObservable< ? submissionChanges,BaseEvent> > - String? successReason,
- Iterable<
IObservable< ? successChanges,BaseEvent> > - Iterable<
IObservable< ? errorChanges,BaseEvent> >
Implementation
FutureOr<bool> submit(
FutureOr<bool> Function() submission, {
String? submissionReason,
Iterable<IObservable<BaseEvent>>? submissionChanges,
String? successReason,
Iterable<IObservable<BaseEvent>>? successChanges,
Iterable<IObservable<BaseEvent>>? errorChanges,
}) async {
try {
submitting(reason: submissionReason, changes: submissionChanges);
final result = await submission();
submissionSuccess(reason: successReason, changes: successChanges);
return result;
} on Exception catch (e) {
submissionError(e, changes: errorChanges);
return false;
}
}