Kite docs

State

The Riverpod patterns Kite uses — and the ones it avoids.

Riverpod 3, no code generation

Codegen is deliberately off. A template is read far more than it is extended, and part 'x.g.dart' plus a build_runner step is a wall between a reader and what the code does. Every provider here is written by hand and visible.

The providers

ProviderTypeHolds
dataProviderProviderThe DataProvider implementation — the one line you swap
sessionProviderNotifierProviderThe signed-in user, or null
themeProviderNotifierProviderTheme mode and accent
localeProviderNotifierProviderActive locale
listParamsProviderNotifierProviderQuery state per resource
listProviderFutureProvider.familyA page of rows, keyed by resource
recordProviderFutureProvider.familyOne record, keyed by (resource, id)

What Kite avoids

StateProvider is legacy in Riverpod 3 and is not used here. Query state is a single Notifier holding a map keyed by resource — fewer moving parts to explain than a provider family, and a template should not teach a deprecated API.

class ListParamsController extends Notifier<Map<String, ListParams>> {
  @override
  Map<String, ListParams> build() => const {};

  ListParams of(String resource) => state[resource] ?? initial;
  void update(String resource, ListParams p) => state = {...state, resource: p};
  void reset(String resource) => update(resource, initial);
}

Refetching

listProvider watches listParamsProvider, so changing the search, a filter or the page refetches automatically. After a mutation, invalidate explicitly:

await ref.read(dataProvider).delete(resource, id);
ref.invalidate(listProvider(resource));
ref.invalidate(recordProvider((resource, id)));

Sessions and persisted preferences

Demo identities remain in memory. Configuring Supabase switches to verified identities, restored sessions, token refresh, email verification, and password recovery. Roles are loaded from a protected server table, not user metadata. See Authentication and roles.

Theme mode, accent, and locale load from PreferencesStore before the first frame. Controllers update immediately and serialize disk writes; Settings offers a retry if saving fails. Display settings contain no tokens. Native sessions and PKCE verifiers use secure storage; web sessions use the SDK's browser storage.

Local widget state stays local

Form fields, toggles, the selected kanban column, which inbox message is open — all StatefulWidget. Riverpod is for state that outlives a screen or is shared across them. Putting a text controller in a provider buys nothing and costs a rebuild.