flutter-change-notifier
Use when setting up ChangeNotifier models, providing them to the widget tree, consuming state with Consumer or Provider.of, or optimizing rebuilds.
Install / Use
npx skills add evanca/flutter-ai-rules --skill flutter-change-notifierInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of flutter-change-notifier
flutter-change-notifier scores 87/100 on our quality scale, 1746th of 4,634 Development & Engineering skills we index (top 38%).
Its SKILL.md is 3.2 KB long, well organised into 9 sections with 7 code examples: a solid amount of guidance for an agent.
It has 646 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 19 days ago, so flutter-change-notifier is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
flutter-change-notifier compared with similar skills
All 4 of these similar skills score higher than flutter-change-notifier; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| flutter-change-notifier (this skill)by evanca | 87 | 646 | 19d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.9k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 3d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 11d ago | SKILL.md |
Frequently asked questions
- How do I install flutter-change-notifier?
- Run
npx skills add evanca/flutter-ai-rules --skill flutter-change-notifier. The install tabs above show the steps for each supported agent. - Which AI agents does flutter-change-notifier work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is flutter-change-notifier safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is flutter-change-notifier still maintained?
- The repository was last updated 19 days ago, so flutter-change-notifier is actively maintained.
Skill content
View source on GitHubname: flutter-change-notifier description: "Use when setting up ChangeNotifier models, providing them to the widget tree, consuming state with Consumer or Provider.of, or optimizing rebuilds." license: MIT
Flutter ChangeNotifier Skill
This skill defines how to correctly use ChangeNotifier with the provider package for state management in Flutter.
1. Model
Extend ChangeNotifier to manage state. Keep internal state private and expose unmodifiable views. Call notifyListeners() on every state change.
class CartModel extends ChangeNotifier {
final List<Item> _items = [];
UnmodifiableListView<Item> get items => UnmodifiableListView(_items);
void add(Item item) {
_items.add(item);
notifyListeners();
}
void removeAll() {
_items.clear();
notifyListeners();
}
}
- Place shared state above the widgets that use it in the widget tree.
- Never directly mutate widgets or call methods on them to change state — rebuild widgets with new data instead.
2. Providing the Model
ChangeNotifierProvider(
create: (context) => CartModel(),
child: MyApp(),
)
ChangeNotifierProviderautomatically disposes of the model when it is no longer needed.- Use
MultiProviderwhen you need to provide multiple models:
MultiProvider(
providers: [
ChangeNotifierProvider(create: (_) => CartModel()),
ChangeNotifierProvider(create: (_) => UserModel()),
],
child: MyApp(),
)
3. Consuming State
Consumer
Consumer<CartModel>(
builder: (context, cart, child) => Stack(
children: [
if (child != null) child,
Text('Total price: ${cart.totalPrice}'),
],
),
child: const SomeExpensiveWidget(), // rebuilt only once
)
- Always specify the generic type (
Consumer<CartModel>, notConsumer). - Use the
childparameter to pass widgets that don't depend on the model — they are built once and reused. - Place
Consumerwidgets as deep in the widget tree as possible to minimize the scope of rebuilds:
HumongousWidget(
child: AnotherMonstrousWidget(
child: Consumer<CartModel>(
builder: (context, cart, child) {
return Text('Total price: ${cart.totalPrice}');
},
),
),
)
Provider.of with listen: false
Use Provider.of<T>(context, listen: false) when you only need to call methods on the model, not react to state changes:
Provider.of<CartModel>(context, listen: false).removeAll();
4. Optimization Rules
- Do not wrap large widget subtrees in a
Consumerif only a small part depends on the model. - Avoid rebuilding widgets unnecessarily — structure your widget tree and provider usage carefully.
- Use
listen: falsein callbacks (e.g.,onPressed) where you trigger actions but don't need rebuilds.
5. Testing
Write unit tests for your ChangeNotifier models to verify state changes and notifications:
test('adding item updates total', () {
final cart = CartModel();
var notified = false;
cart.addListener(() => notified = true);
cart.add(Item('Book'));
expect(cart.items.length, 1);
expect(notified, isTrue);
});
References
Related Skills
ai-job-search
44.9kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
