refresh<Created> method

Created refresh<Created>(
  1. ProviderBase<Created> provider

Forces a provider to re-evaluate its state immediately, and return the created value.

This method is useful for features like "pull to refresh" or "retry on error", to restart a specific provider.


Created refresh<Created>(ProviderBase<Created> provider) {
  final reader = _getStateReader(provider.originProvider);

  if (reader._element != null) {
    final element = reader._element!;

  return read(provider);