get method

  1. @override
Future<E?> get()
override

Gets the item, uses the cached version if present. Otherwise, fetches a fresh value, caches, and returns it. On error throws.

Implementation

@override
Future<E?> get() async {
  if (!_isItemFetched) {
    _cachedItem = await _inner.get();
    _isItemFetched = true;
  }
  return _cachedItem;
}