fetch method

  1. @protected
Future<void> fetch(
  1. Future future()
)

future 실행 전후에 로딩 값을 변경한다.

Implementation

@protected
Future<void> fetch(
  Future Function() future,
) async {
  try {
    loading = true;
    await future();
  } catch (e, t) {
    if (kDebugMode) {
      print(e);
      print(t);
    }
  } finally {
    if (mounted) loading = false;
  }
}