riverpod-auto-dispose

Installation
SKILL.md

Riverpod — Automatic disposal

Instructions

With automatic disposal enabled, Riverpod destroys a provider's state when it has no listeners for one frame. This frees memory and stops work (e.g. network requests) when the provider is no longer used.

Enabling

  • Code generation: Enabled by default. Disable with @Riverpod(keepAlive: true).
  • Manual: Add isAutoDispose: true when creating the provider (e.g. Provider.autoDispose(...) or FutureProvider.autoDispose(...)).
// Codegen: disable auto-dispose
(keepAlive: true)
String helloWorld(Ref ref) => 'Hello world!';
Installs
74
GitHub Stars
9
First Seen
Mar 20, 2026
riverpod-auto-dispose — serverpod/skills-registry