ProviderCache<T> extension

Adds caching functionality to Ref<T> objects.

Keeps Ref<T> objects, typically Riverpod providers, alive for a specified duration, preventing them from being disposed immediately after they're no longer listened to.

See cacheFor

on
  • Ref<T>

Methods

cacheFor(Duration duration) → void

Available on Ref<T>, provided by the ProviderCache extension

Keeps the surrounding provider alive for duration.