accessibility
Use when working on accessibility, a11y, WCAG, ARIA, screen readers, keyboard nav, focus order, contrast, alt text, captions, reduced motion, or target sizes;…
Use when setting up providers, consuming state, optimizing rebuilds, using ProxyProvider, or migrating from deprecated providers (Provider package).
$ npx -y skills add evanca/flutter-ai-rules --skill provider --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/providerContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when setting up providers, consuming state, optimizing rebuilds, using ProxyProvider, or migrating from deprecated providers (Provider package).
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, reduced motion, or target sizes;…
Use when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns…
Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or…
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 values, or modernizing…
Use when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.