Install
$ agentstack add skill-evanca-flutter-ai-rules-flutter-change-notifier ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
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 _items = [];
UnmodifiableListView 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(
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, 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(
builder: (context, cart, child) {
return Text('Total price: ${cart.totalPrice}');
},
),
),
)
Provider.of with listen: false
Use Provider.of(context, listen: false) when you only need to call methods on the model, not react to state changes:
Provider.of(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
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: evanca
- Source: evanca/flutter-ai-rules
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.