withLoading<T> static method
void
withLoading<T>(
- BuildContext context, {
- required Future<
T> action(), - required dynamic onSuccess(
- T result
- dynamic onError(
- Object error
- dynamic onComplete()?,
- String? errorMessage,
Implementation
static void withLoading<T>(
BuildContext context, {
required Future<T> Function() action,
required Function(T result) onSuccess,
Function(Object error)? onError,
Function()? onComplete,
String? errorMessage,
}) {
execute(
context: context,
action: action,
onSuccess: onSuccess,
onError: onError,
onComplete: onComplete,
errorMessage: errorMessage,
);
}