Email Confirmation and refactor for snackbar
This commit is contained in:
@@ -13,19 +13,18 @@ Future<void> invokeAndNotify<T>(
|
||||
void Function(Object)? onError,
|
||||
void Function(T)? onSuccess,
|
||||
}) async {
|
||||
final sm = ScaffoldMessenger.of(context);
|
||||
final locs = AppLocalizations.of(context)!;
|
||||
try {
|
||||
final res = await operation();
|
||||
if (operationSuccess != null) {
|
||||
notifyUserX(sm, operationSuccess);
|
||||
await notifyUser(context, operationSuccess);
|
||||
}
|
||||
if (onSuccess != null) {
|
||||
onSuccess(res);
|
||||
}
|
||||
} catch (e) {
|
||||
notifyUserOfErrorX(
|
||||
scaffoldMessenger: sm,
|
||||
context: context,
|
||||
errorSituation: operationError ?? locs.errorInternalError,
|
||||
exception: e,
|
||||
appLocalizations: locs,
|
||||
|
||||
Reference in New Issue
Block a user