DataDelegate<V> constructor

DataDelegate<V>({
  1. required _FromNetwork<V> fromNetwork,
  2. _FromMemory<V>? fromMemory,
  3. _ToMemory<V>? toMemory,
  4. _FromStorage<V>? fromStorage,
  5. _ToStorage<V>? toStorage,
  6. _ClearCache? onClearCache,
})

Implementation

DataDelegate({
  required this.fromNetwork,
  this.fromMemory,
  this.toMemory,
  this.fromStorage,
  this.toStorage,
  this.onClearCache,
})  : assert(
        (toStorage == null && toMemory == null) ||
            (toStorage != null || toMemory != null) && onClearCache != null,
        'You must provide `onClearCache` callback when using `toStorage` and/or `toMemory`.',
      ),
      super(Data<V>(isLoading: true)) {
  _init();
}