Quick API lookup for daily work.

The page summarizes the commonly used classes and methods in miniriverpod_core.dart and miniriverpod_flutter.dart. The workflow remains easy to review.

Core Types

Core state and provider primitives.

AsyncValue<T>

AsyncLoading / AsyncData / AsyncError

Provider<T>

Synchronous provider with optional autoDispose

AsyncProvider<T>

Asynchronous provider with .future selector

Reading tip. Review the next action before handoff.

AsyncValue does not include a when method; use switch pattern matching or is checks.

Ref and ProviderContainer Methods

Common operational methods for refreshing, invalidating, wiring lifecycles, and executing mutations.

Common sequence

Method map

read / watch / listen                 : read and subscribe to providers.
invalidate / refresh / refreshValue    : recompute state.
onDispose / keepAlive / emit           : lifecycle and stream wiring.
mutation / mutate / invoke             : tracked write operations.
scope / overrideWithValue              : DI and testing overrides.

Flutter API snapshot for daily work

ProviderScope + WidgetRef entry points used in app code.

// Scope
ProviderScope(
  child: const App(),
);

// ConsumerWidget
class Header extends ConsumerWidget {
  const Header({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final user = ref.watch(currentUser);
    return Text('$user');
  }
}

// Mutation execution
await ref.invoke(userProvider.rename('Alice'));
ProviderScope(container: external) requires manual container.dispose().
UncontrolledProviderScope never disposes injected container.
Consumer, ConsumerWidget, and ConsumerStatefulWidget are all supported.

Next Steps

Providers

Return to practical usage of Provider, AsyncProvider, and read APIs.

Open Providers

Mutations

Implement explicit write flows with concurrency control.

Open Mutations