Loader<T> constructor

Loader<T>({
  1. required FutureOr<T?> load(),
  2. StatefulServiceCache<T?>? cache,
  3. bool verboseLogging = false,
  4. bool autoInitialize = false,
})

Implementation

Loader({required FutureOr<T?> Function() load, super.cache, super.verboseLogging, bool autoInitialize = false})
    : _load = load,
      super(initialState: autoInitialize && load is T? Function() ? load() : null) {
  if (autoInitialize && load is Future<T?> Function()) {
    initialize();
  }
}