commonFuture property

Refreshable<Future<T>> get commonFuture

Returns the common future provider if this object is one of the built-in async value providers in riverpod.

Implementation

Refreshable<Future<T>> get commonFuture {
  final provider = this;
  if (provider is FutureProvider<T>) return provider.future;
  if (provider is AutoDisposeFutureProvider<T>) return provider.future;
  if (provider is StreamProvider<T>) return provider.future;
  if (provider is AutoDisposeStreamProvider<T>) return provider.future;

  throw UnsupportedError('This provider $this does not have a common future');
}