Fireworks Flutter v3.0 — Master Skill
The definitive Flutter & Dart development skill for Claude Code.
Covers architecture, state management, navigation, animations, platform channels, testing, premium UI, and security.
Compound skill — auto-chains to fireworks-test, fireworks-security, fireworks-debug when relevant.
1. Flutter Development Protocol
Every Flutter task follows this pipeline:
- Understand — Read the requirement. Clarify ambiguity before writing code.
- Architect — Choose architecture pattern (clean arch for features, simple for prototypes).
- Scaffold — Create directory structure, define models, interfaces, and routes.
- Implement — Write code feature-by-feature, smallest testable unit first.
- Test — Widget tests for every screen, unit tests for logic, integration tests for flows.
- Analyze — Run
flutter analyze — zero warnings, zero errors.
- Verify — Run on device/emulator. Check both light AND dark themes.
- Deploy — Build release, test release mode, deliver.
Mandatory Commands Before Claiming Done
flutter analyze # Must show: No issues found!
flutter test # Must show: All tests passed!
dart format lib/ test/ # Code must be formatted
Dart 3.7-3.10 Language Features
| Feature |
Dart |
Example |
Wildcard _ |
3.7 |
for (final (name, _, _) in records) |
| New formatter |
3.7 |
Better trailing comma handling |
| Null-aware collections |
3.8 |
[?Text(subtitle), ...?extraTags] |
| Dot shorthands |
3.10 |
.all(16) instead of EdgeInsets.all(16) |
| Augmentations |
3.10 |
Replaces cancelled macros, same codegen workflow |
| Build hooks |
3.10 |
Native code compilation without shell scripts |
See references/dart-modern-features.md for full examples and migration tips.
Decision: When NOT to Use Flutter
- Pure backend service -> Use Dart server (shelf/dart_frog) or other backend
- Simple static website -> Use HTML/CSS or Next.js
- Heavy 3D graphics -> Use Unity/Unreal with Flutter embedding
- Native-only feature -> Write platform channel, not pure Flutter
2. Project Structure (Clean Architecture)
lib/
core/ # Shared across ALL features
constants/
app_constants.dart # App-wide constants
api_endpoints.dart # API URLs
error/
exceptions.dart # Custom exceptions
failures.dart # Failure classes for Either
theme/
app_theme.dart # ThemeData for light/dark
app_colors.dart # ColorScheme definitions
app_text_styles.dart # TextTheme definitions
theme_extensions.dart # Custom ThemeExtension<T>
utils/
extensions.dart # Dart extension methods
validators.dart # Form validators
formatters.dart # Date, currency formatters
widgets/ # Shared reusable widgets
app_button.dart
app_text_field.dart
loading_indicator.dart
error_widget.dart
shimmer_loading.dart
features/ # Feature-first organization
auth/
data/
datasources/
auth_remote_datasource.dart
auth_local_datasource.dart
models/
user_model.dart # JSON serialization, fromJson/toJson
repositories/
auth_repository_impl.dart
domain/
entities/
user.dart # Pure Dart class, no dependencies
repositories/
auth_repository.dart # Abstract interface
usecases/
login_usecase.dart
logout_usecase.dart
get_current_user_usecase.dart
presentation/
pages/
login_page.dart
register_page.dart
widgets/
login_form.dart
social_login_buttons.dart
providers/ # Riverpod providers (or bloc/)
auth_provider.dart
auth_state.dart
home/
data/
domain/
presentation/
settings/
data/
domain/
presentation/
app.dart # MaterialApp.router setup
main.dart # Entry point, ProviderScope
test/
core/
utils/
features/
auth/
data/
repositories/
domain/
usecases/
presentation/
pages/
home/
helpers/
test_helpers.dart # Shared test utilities
pump_app.dart # Helper to pump widget with providers
mock_data.dart # Shared mock data
integration_test/
app_test.dart
When to Use Clean Architecture
| Project Size |
Recommendation |
| Prototype / POC |
Single folder, no layers. Speed over structure. |
| Small app (< 5 screens) |
Feature folders with simple separation. |
| Medium app (5-20 screens) |
Full clean architecture per feature. |
| Enterprise app (20+ screens) |
Clean architecture + modular packages. |
3. State Management Decision Tree
| Scenario |
Recommended |
Why |
| Simple local UI state (toggle, counter) |
setState / ValueNotifier |
Minimal overhead, no dependencies |
| Form state with validation |
TextEditingController + ValueNotifier |
Built-in, no extra packages |
| Feature-level state with async |
Riverpod 3.0 |
Compile-time safety, auto-disposal, no BuildContext |
| Enterprise/regulated app (audit trail) |
BLoC 9.0 |
Event-driven, strict separation, replay/undo |
| Legacy app with existing Provider |
Provider |
Don't rewrite what works |
| Global app state (auth, theme, locale) |
Riverpod |
Dependency injection built-in, testable |
| Real-time data (WebSocket, Firestore) |
Riverpod StreamProvider or BLoC |
Stream-native support |
| Complex UI with many interdependent states |
Riverpod |
Provider composition, granular rebuilds |
Key Rule: Never Mix State Management Libraries
Pick ONE primary state management solution per project. Using Riverpod + BLoC + Provider in the same app creates confusion.
Full Reference
For complete patterns, examples, and advanced usage, see references/full-guide.md.
Read that file when you need deeper context than the summary above.
1---
2name: fireworks-flutter
3version: 3.0.0
4author: mneme
5description: Use when building Flutter/Dart apps, debugging Flutter issues, reviewing Flutter PRs, choosing state management, testing widgets/providers, optimizing Flutter performance, or auditing mobile security. Covers Flutter 3.38, Dart 3.10, Riverpod 3.0, BLoC 9.x, GoRouter, clean architecture, Impeller, OWASP Mobile Top 10.
6triggers:
7 - flutter
8 - dart
9 - widget
10 - riverpod
11 - bloc
12 - mobile
13 - ios
14 - android
15 - pubspec
16 - freezed
17 - go_router
18 - pigeon
19 - impeller
20tags:
21 - flutter
22 - dart
23 - mobile
24 - state-management
25 - riverpod
26 - bloc
27 - widgets
28 - testing
29 - ios
30 - android
31metadata:
32 source: https://skillmd.com/skills/aibot88/fireworks-flutter
33---
34
35# Fireworks Flutter v3.0 — Master Skill
36
37> The definitive Flutter & Dart development skill for Claude Code.
38> Covers architecture, state management, navigation, animations, platform channels, testing, premium UI, and security.
39> **Compound skill** — auto-chains to `fireworks-test`, `fireworks-security`, `fireworks-debug` when relevant.
40
41---
42
43## 1. Flutter Development Protocol
44
45Every Flutter task follows this pipeline:
46
471. **Understand** — Read the requirement. Clarify ambiguity before writing code.
482. **Architect** — Choose architecture pattern (clean arch for features, simple for prototypes).
493. **Scaffold** — Create directory structure, define models, interfaces, and routes.
504. **Implement** — Write code feature-by-feature, smallest testable unit first.
515. **Test** — Widget tests for every screen, unit tests for logic, integration tests for flows.
526. **Analyze** — Run `flutter analyze` — zero warnings, zero errors.
537. **Verify** — Run on device/emulator. Check both light AND dark themes.
548. **Deploy** — Build release, test release mode, deliver.
55
56### Mandatory Commands Before Claiming Done
57
58```bash
59flutter analyze # Must show: No issues found!
60flutter test # Must show: All tests passed!
61dart format lib/ test/ # Code must be formatted
62```
63
64### Dart 3.7-3.10 Language Features
65
66| Feature | Dart | Example |
67|---|---|---|
68| Wildcard `_` | 3.7 | `for (final (name, _, _) in records)` |
69| New formatter | 3.7 | Better trailing comma handling |
70| Null-aware collections | 3.8 | `[?Text(subtitle), ...?extraTags]` |
71| Dot shorthands | 3.10 | `.all(16)` instead of `EdgeInsets.all(16)` |
72| Augmentations | 3.10 | Replaces cancelled macros, same codegen workflow |
73| Build hooks | 3.10 | Native code compilation without shell scripts |
74
75See `references/dart-modern-features.md` for full examples and migration tips.
76
77### Decision: When NOT to Use Flutter
78
79- Pure backend service -> Use Dart server (shelf/dart_frog) or other backend
80- Simple static website -> Use HTML/CSS or Next.js
81- Heavy 3D graphics -> Use Unity/Unreal with Flutter embedding
82- Native-only feature -> Write platform channel, not pure Flutter
83
84---
85
86## 2. Project Structure (Clean Architecture)
87
88```
89lib/
90 core/ # Shared across ALL features
91 constants/
92 app_constants.dart # App-wide constants
93 api_endpoints.dart # API URLs
94 error/
95 exceptions.dart # Custom exceptions
96 failures.dart # Failure classes for Either
97 theme/
98 app_theme.dart # ThemeData for light/dark
99 app_colors.dart # ColorScheme definitions
100 app_text_styles.dart # TextTheme definitions
101 theme_extensions.dart # Custom ThemeExtension<T>
102 utils/
103 extensions.dart # Dart extension methods
104 validators.dart # Form validators
105 formatters.dart # Date, currency formatters
106 widgets/ # Shared reusable widgets
107 app_button.dart
108 app_text_field.dart
109 loading_indicator.dart
110 error_widget.dart
111 shimmer_loading.dart
112 features/ # Feature-first organization
113 auth/
114 data/
115 datasources/
116 auth_remote_datasource.dart
117 auth_local_datasource.dart
118 models/
119 user_model.dart # JSON serialization, fromJson/toJson
120 repositories/
121 auth_repository_impl.dart
122 domain/
123 entities/
124 user.dart # Pure Dart class, no dependencies
125 repositories/
126 auth_repository.dart # Abstract interface
127 usecases/
128 login_usecase.dart
129 logout_usecase.dart
130 get_current_user_usecase.dart
131 presentation/
132 pages/
133 login_page.dart
134 register_page.dart
135 widgets/
136 login_form.dart
137 social_login_buttons.dart
138 providers/ # Riverpod providers (or bloc/)
139 auth_provider.dart
140 auth_state.dart
141 home/
142 data/
143 domain/
144 presentation/
145 settings/
146 data/
147 domain/
148 presentation/
149 app.dart # MaterialApp.router setup
150 main.dart # Entry point, ProviderScope
151test/
152 core/
153 utils/
154 features/
155 auth/
156 data/
157 repositories/
158 domain/
159 usecases/
160 presentation/
161 pages/
162 home/
163 helpers/
164 test_helpers.dart # Shared test utilities
165 pump_app.dart # Helper to pump widget with providers
166 mock_data.dart # Shared mock data
167integration_test/
168 app_test.dart
169```
170
171### When to Use Clean Architecture
172
173| Project Size | Recommendation |
174|-------------|---------------|
175| Prototype / POC | Single folder, no layers. Speed over structure. |
176| Small app (< 5 screens) | Feature folders with simple separation. |
177| Medium app (5-20 screens) | Full clean architecture per feature. |
178| Enterprise app (20+ screens) | Clean architecture + modular packages. |
179
180---
181
182## 3. State Management Decision Tree
183
184| Scenario | Recommended | Why |
185|----------|------------|-----|
186| Simple local UI state (toggle, counter) | `setState` / `ValueNotifier` | Minimal overhead, no dependencies |
187| Form state with validation | `TextEditingController` + `ValueNotifier` | Built-in, no extra packages |
188| Feature-level state with async | **Riverpod 3.0** | Compile-time safety, auto-disposal, no BuildContext |
189| Enterprise/regulated app (audit trail) | **BLoC 9.0** | Event-driven, strict separation, replay/undo |
190| Legacy app with existing Provider | **Provider** | Don't rewrite what works |
191| Global app state (auth, theme, locale) | **Riverpod** | Dependency injection built-in, testable |
192| Real-time data (WebSocket, Firestore) | **Riverpod StreamProvider** or **BLoC** | Stream-native support |
193| Complex UI with many interdependent states | **Riverpod** | Provider composition, granular rebuilds |
194
195### Key Rule: Never Mix State Management Libraries
196
197Pick ONE primary state management solution per project. Using Riverpod + BLoC + Provider in the same app creates confusion.
198
199---
200
201---
202
203## Full Reference
204
205For complete patterns, examples, and advanced usage, see [`references/full-guide.md`](./references/full-guide.md).
206Read that file when you need deeper context than the summary above.