withLoading method

Future<T> withLoading([
  1. String? message,
  2. Duration timeout = const Duration(minutes: 5)
])

Implementation

Future<T> withLoading([String? message, Duration timeout = const Duration(minutes: 5)]) async {
  GlobalLoadingView.show(message);
  try {
    T result = await this.timeout(timeout);
    GlobalLoadingView.dismiss();
    return result;
  } catch (e) {
    GlobalLoadingView.dismiss();
    rethrow;
  }
}