accessibility
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions,…
Use when setting up providers, consuming state, optimizing rebuilds, using ProxyProvider, or migrating from deprecated providers (Provider package).
Claude Code
$ npx -y skills add evanca/flutter-ai-rules --skill provider --agent claude-code
Codex
$ npx skills add evanca/flutter-ai-rules --skill provider -a codex -y
Cursor
$ npx skills add evanca/flutter-ai-rules --skill provider -a cursor -y
Gemini CLI
$ npx skills add evanca/flutter-ai-rules --skill provider -a gemini-cli -y
GitHub Copilot
$ npx skills add evanca/flutter-ai-rules --skill provider -a github-copilot -y
OpenCode
$ npx skills add evanca/flutter-ai-rules --skill provider -a opencode -y
Windsurf
$ npx skills add evanca/flutter-ai-rules --skill provider -a windsurf -y
name: provider description: "Use when setting up providers, consuming state, optimizing rebuilds, using ProxyProvider, or migrating from deprecated providers (Provider package)." license: MIT
This skill defines how to correctly use the `provider` package in Flutter applications.
---
| Provider | Use for | |---|---| | `Provider` | Exposing any immutable value | | `ChangeNotifierProvider` | Mutable state with `ChangeNotifier` | | `FutureProvider` | Exposing a `Future` result | | `StreamProvider` | Exposing a `Stream` | | `ProxyProvider` / `ChangeNotifierProxyProvider` | Objects that depend on other providers |
---
MultiProvider(
providers: [
Provider<Something>(create: (_) => Something()),
ChangeNotifierProvider(create: (_) => MyNotifier()),
FutureProvider<String>(create: (_) => fetchData(), initialData: ''),
],
child: MyApp(),
)---
Always specify the **generic type** for type safety:
// Listen and rebuild on change — only valid inside build() or a Provider's update method final count = context.watch<MyModel>().count; // Access without listening — use in callbacks, not inside build() context.read<MyModel>().increment(); // Listen to only part of the state final count = context.select<MyModel, int>((m) => m.count);
Use `Consumer<T>` or `Selector<T, R>` widgets when you need fine-grained rebuilds and cannot access a descendant `BuildContext`:
Consumer<MyModel>(
builder: (context, model, child) => Text('${model.count}'),
child: const ExpensiveWidget(), // rebuilt only once
)
Selector<MyModel, int>(
selector: (_, model) => model.count,
builder: (_, count, __) => Text('$count'),
)---
Use `ProxyProvider` or `ChangeNotifierProxyProvider` for objects that depend on other providers or values that can change:
MultiProvider(
providers: [
Provider<Auth>(create: (_) => Auth()),
ProxyProvider<Auth, Api>(
update: (_, auth, __) => Api(auth.token),
),
],
)---
---
Implement `toString` or `DiagnosticableTreeMixin` to improve how your objects appear in Flutter DevTools:
class MyModel with DiagnosticableTreeMixin {
final int count;
MyModel(this.count);
@override
String toString() => 'MyModel(count: $count)';
}---
`ValueListenableProvider` is deprecated. Use `Provider` with `ValueListenableBuilder` instead:
ValueListenableBuilder<int>(
valueListenable: myValueListenable,
builder: (context, value, _) {
return Provider<int>.value(
value: value,
child: MyApp(),
);
},
)---
36 Flutter and Dart skills your coding agent loads by itself, sourced only from official documentation. A skill is a folder with a SKILL.md file.
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions,…
Use when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection,…
Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring…
Use when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.
Use when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring…
Use when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.