Riverpod-style ergonomics with explicit runtime behavior.
miniriverpod keeps Provider and AsyncProvider familiar, but narrows behavior into explicit APIs: subclass + args for family-like identity, mutation tokens for updates, and predictable lifecycle disposal.
No Code Generation
family-like providers, overrides, and dependency injection are modeled with subclass + args + Scope, without code generation.
Unified Async Model
A single AsyncProvider handles Future and Stream, with strict cancellation on rebuild, invalidate, refresh, and dispose.
Built-in Concurrency
Mutation calls support concurrent, queue, restart, and dropLatest via ref.invoke(provider.method()).
Recommended Onboarding Flow
Wrap your app with ProviderScope, define Provider/AsyncProvider classes, and run state updates through ref.invoke with explicit concurrency.
Install
flutter pub add miniriverpod
Mutation + Invoke
class UserProvider extends AsyncProvider<User?> {
UserProvider() : super.args(null);
late final renameMut = mutation<void>(#rename);
Call<void, AsyncValue<User?>> rename(String name) => mutate(
renameMut,
(ref) async {
final api = ref.watch(apiProvider);
await api.rename(name);
ref.state = AsyncData(await api.me());
},
concurrency: Concurrency.restart,
);
}
// UI
await ref.invoke(userProvider.rename('Alice'));
Compatibility Note
miniriverpod intentionally keeps Provider + AsyncProvider + WidgetRef close to Riverpod, but replaces codegen-heavy paths with subclass + args, Scope-based injection, and explicit mutation calls.
Previous
Open SourceNext
Installation