asyncRefresh<T> method
- ProviderBase<
AsyncValue< providerT> >
Refresh a future provider in a safe manner. This method returns instantly if the underlying value of the provider is loading.
Implementation
Future<void> asyncRefresh<T>(ProviderBase<AsyncValue<T>> provider) async {
final value = read(provider);
if (value.isLoading) return;
return refresh(provider.commonFuture);
}