flutter-mobile
Skill36 starsChanged 6 months agoMITView on GitHub
This skill provides patterns and templates for Flutter 3.41.x / Dart 3.10.9 cross-platform mobile development. It should be activated when building Flutter screens, Riverpod providers, Freezed models, or widget tests.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- medy-gribkov/arcanatheir own version, first seen Mar 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- medy-gribkov/arcana★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository157 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a2ui-angularSkill
- accessibility-auditSkill
- adk-deploy-guideSkill
- adk-dev-guideSkill
- adk-eval-guideSkill
- adk-observability-guideSkill
- agentic-ai-coding-standardSkill
- agentic-ai-devSkill
- ai-auditSkill
- ai-chatSkill
- ai-decision-recordSkill
- ai-incident-responseSkill
- ai-launch-checkSkill
- ai-playbookSkill
- angular-best-practicesSkill
- angularSkill
- angular-spaSkill
- angular-ui-patternsSkill
- api-design-principlesSkill
- app-store-optimizationSkill
- architect-reviewSkill
- architecture-decision-recordsSkill
- architecture-designSkill
- asc-cli-usageSkill
- asc-crash-triageSkill
- asc-id-resolverSkill
- asc-release-flowSkill
- asc-signing-setupSkill
- asc-submission-healthSkill
- asc-testflight-orchestrationSkill
- browser-testingSkill
- changelog-generatorSkill
- claude-actions-auditorSkill
- clean-codeSkill
- codebase-onboardingSkill
- code-explainerSkill
- code-reviewerSkill
- code-simplifierSkill
- comment-analyzerSkill
- database-schema-designerSkill
- ddd-architectSkill
- decision-frameworksSkill
- dedup-code-agentSkill
- deployment-ci-cdSkill
- design-systemSkill
- dockerSkill
- documentation-generationSkill
- domain-finderSkill
- error-detectiveSkill
- eval-guideSkill
- feature-forgeSkill
- firebase-basicsSkill
- firebase-hosting-basicsSkill
- fixing-accessibilitySkill
- fixing-motion-performanceSkill
- flutter-animationsSkill
- flutter-genuiSkill
- flutter-security-expertSkill
- frontend-designSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 10 are distinctive, and 20 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Use Riverpod for state management
- Very specific: line 23
Follow feature-first folder structure: lib/features/<feature>/
- Very specific: line 25
Use freezed for immutable models
- Very specific: line 61
Do NOT create a lib/design_system/ directory in individual apps — shared UI components belong in the workspace's shared UI package.
- Distinctive: line 69
Before creating or modifying any widget, screen, or visual component:
- Distinctive: line 74
If not → read the reference file before writing any widget code
- Very specific: line 79
Read templates: - Use Read tool on reference/flutter-templates.md for all code templates (Freezed models, Riverpod providers, screens, …
- Very specific: line 81
Define models: - Create Freezed data models in data/models/ with Firestore serialization
- Very specific: line 82
Build providers: - Create Riverpod notifiers with @riverpod annotation in presentation/providers/
- Very specific: line 85
Write tests: - Create widget tests with ProviderScope overrides
- Distinctive: line 104
Read reference/flutter-architecture-patterns.md — Sealed classes, Result types, Riverpod AsyncNotifier Read …
- Distinctive: line 105
Read reference/flutter-performance-ux.md — Accessibility, performance, haptic feedback, shimmer, animations Read …
- Distinctive: line 106
Read reference/flutter-design-polish.md — Glassmorphism, premium cards, dark/light themes, gradients Read …
- Very specific: line 107
Read reference/accessibility-audit-checklist.md — WCAG 2.1 audit checklist (used by accessibility-auditor agent) Read …
- Very specific: line 108
Read reference/flutter-security-hardening.md — Security hardening & privacy compliance (used by flutter-security-expert agent) Read …
- Distinctive: line 109
Read reference/smart-dumb-widgets.md — Smart (ConsumerWidget) vs Dumb (StatelessWidget) pattern, ref.watch/read placement rules, decision …
- Distinctive: line 110
Read reference/flutter-use-case-layer.md — When to add a use case, when not to, file location, example with two repositories, unit testing …
- Distinctive: line 114
Before generating code, consult these sources for current syntax and APIs:
- Very specific: line 156
First build: Run flutter build ios once first to generate the Xcode project and Pods
- Very specific: line 188
Use appId matching your app's bundle ID
- Very specific: line 195
Timing: Use waitForAnimationToEnd or extendedWaitUntil for slow transitions, not hardcoded sleeps
- Very specific: line 213
Build runner fails: Delete .dart_tool/build/, run flutter clean, retry codegen
- Very specific: line 215
Missing generated files: Ensure part directives match filename (e.g., part 'user_model.g.dart';)
- Very specific: line 217
Provider not found: Run dart run build_runner build, import generated .g.dart file
- Very specific: line 219
Firestore Timestamp errors: Use (data['createdAt'] as Timestamp).toDate() in fromFirestore
- Very specific: line 223
AsyncValue stuck loading: Check repository returns data, use AsyncValue.guard() to catch errors
- Very specific: line 228
No returning null on async error — use AsyncValue.error, never null/empty fallbacks
- Very specific: line 230
No raw EdgeInsets with numeric values — use AppSpacing.* tokens
- Very specific: line 231
No inline TextStyle(fontSize: ...) — use Theme.of(context).textTheme.*
- Distinctive: line 297
After writing Dart code, dispatch these reviewer agents:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Iron Law
NO FLUTTER UI WITHOUT RUNNING THE MFRI RISK SCORE FIRST — load reference/mfri-scoring.md before writing any screen
Flutter Mobile Development Skill
Code Conventions
- Use Riverpod for state management
- Follow feature-first folder structure:
lib/features/<feature>/ - Separate
data/,domain/,presentation/layers (clean architecture) - Use
freezedfor immutable models - Firebase integration via
firebase_core,cloud_firestore,firebase_auth
Quick Scaffold
flutter create --org com.company --platforms ios,android my_app
cd my_app
# Add core dependencies
flutter pub add flutter_riverpod riverpod_annotation
flutter pub add freezed_annotation json_annotation go_router firebase_core cloud_firestore firebase_auth
flutter pub add dio
flutter pub add dev:riverpod_generator dev:freezed dev:json_serializable dev:build_runner dev:mocktail
# Run code generation
dart run build_runner build --delete-conflicting-outputsMelos Workspace Commands
In a Melos monorepo, use these commands at the workspace root:
melos bootstrap— installs all Flutter workspace dependencies (run at root, NOTflutter pub get)melos run test— runs tests across all packagesmelos run build_runner— runs code generation across all packages
Shared Packages (monorepo pattern)
In a Melos workspace, individual apps reference shared packages by path rather than publishing them. Example:
dependencies:
<shared_ui_package>:
path: ../../packages/<shared_ui_package>
<shared_core_package>:
path: ../../packages/<shared_core_package>Do NOT create a lib/design_system/ directory in individual apps — shared UI components belong in the workspace's shared UI package.
Dio HTTP Client (monorepo pattern)
In a Melos workspace, place the shared Dio instance with auth + retry interceptors in the shared core package's providers directory. Do NOT create new Dio instances in individual features.
Before Writing Any UI Code
Before creating or modifying any widget, screen, or visual component:
- Run MFRI scoring — read
reference/mfri-scoring.mdand complete the checkpoint template. Score < 3 = stop and redesign. Score 3-5 = add a validation milestone. - Load
ui-standards-tokensskill — readreference/ui-design-tokens.mdfor spacing, color, typography, radius tokens - Verify token awareness — can you name the spacing token (
AppSpacing.md), color approach (Theme.of(context).colorScheme), and typography pattern (Theme.of(context).textTheme) you will use? - If not → read the reference file before writing any widget code
- For accessibility: read
reference/ui-accessibility-patterns.mdbefore adding interactive elements
Process
- Read templates - Use Read tool on
reference/flutter-templates.mdfor all code templates (Freezed models, Riverpod providers, screens, GoRouter, tests, Firebase integration) - Create feature structure - Build
lib/features/<feature>/data/,domain/,presentation/directories - Define models - Create Freezed data models in
data/models/with Firestore serialization - Build providers - Create Riverpod notifiers with
@riverpodannotation inpresentation/providers/ - Design screens - Build
ConsumerWidgetscreens that watchAsyncValue<T>providers - Run codegen - Execute
dart run build_runner build --delete-conflicting-outputs - Write tests - Create widget tests with
ProviderScopeoverrides
Key Patterns
| Pattern | Description |
@freezed models | Immutable data classes with fromFirestore factory |
@riverpod providers | Code-generated state notifiers with AsyncValue |
ConsumerWidget | Widgets that watch providers via ref.watch() |
AsyncValue.when() | Handle loading/error/data states declaratively |
| Clean Architecture | Separate data/domain/presentation layers |
| GoRouter | Declarative routing with path parameters |
| Firebase Auth | Stream-based auth state with authStateChanges() |
| Firestore snapshots | Real-time data with .snapshots() streams |
Modern Flutter Architecture (2025/2026)
For architecture patterns, accessibility, performance, UX, and premium polish guidelines:
Read reference/flutter-architecture-patterns.md — Sealed classes, Result types, Riverpod AsyncNotifier
Read reference/flutter-performance-ux.md — Accessibility, performance, haptic feedback, shimmer, animations
Read reference/flutter-design-polish.md — Glassmorphism, premium cards, dark/light themes, gradients
Read reference/accessibility-audit-checklist.md — WCAG 2.1 audit checklist (used by accessibility-auditor agent)
Read reference/flutter-security-hardening.md — Security hardening & privacy compliance (used by flutter-security-expert agent)
Read reference/smart-dumb-widgets.md — Smart (ConsumerWidget) vs Dumb (StatelessWidget) pattern, ref.watch/read placement rules, decision tree, Riverpod enforcement gates
Read reference/flutter-use-case-layer.md — When to add a use case, when not to, file location, example with two repositories, unit testing with fakes
Documentation Sources
Before generating code, consult these sources for current syntax and APIs:
| Source | URL / Tool | Purpose |
| Flutter / Dart | Dart MCP server | Latest Flutter widgets, Dart syntax, platform APIs |
| Riverpod | Context7 MCP | Provider types, ref usage, AsyncValue patterns |
| Firebase Firestore | Firebase MCP server | Firestore operations, rules validation, auth flows |
iOS Build, Run & Debug (XcodeBuildMCP)
For iOS-specific workflows, use the xcodebuild MCP server instead of raw CLI commands. It provides structured output, error parsing, and debugging that flutter build ios via Bash cannot.
When to Use Which
| Task | Use This | Not This |
| Build iOS for simulator | build_sim (MCP) | flutter build ios --simulator (Bash) |
| Build + install + launch on simulator | build_run_sim (MCP) | flutter run (Bash) |
| Build for physical device | build_device (MCP) | flutter build ios (Bash) |
| Debug a crash or inspect state | debug_attach_sim → debug_variables (MCP) | Manual Xcode debugging |
| Capture runtime logs | start_sim_log_cap / stop_sim_log_cap (MCP) | Reading console manually |
| Check signing/scheme config | show_build_settings / list_schemes (MCP) | xcodebuild -showBuildSettings (Bash) |
| UI interaction (tap, swipe, type) | tap, swipe, type_text (MCP) | Not available via Bash |
| Build Android | flutter build apk (Bash) | N/A — XcodeBuildMCP is iOS/macOS only |
iOS Debug Workflow
1. discover_projs → find ios/Runner.xcworkspace
2. list_schemes → identify the Runner scheme
3. build_run_sim → build, install, and launch on simulator
4. start_sim_log_cap → begin capturing logs
5. [reproduce the issue]
6. debug_attach_sim → attach LLDB debugger
7. debug_breakpoint_add → set breakpoint at suspect line
8. debug_variables / debug_stack → inspect state
9. stop_sim_log_cap → get captured logsGotchas
- Flutter projects: The Xcode project is at
ios/Runner.xcworkspace, not the project root - First build: Run
flutter build iosonce first to generate the Xcode project and Pods - Signing:
show_build_settingsexposes signing config — use this to diagnose code signing failures - Scheme name: Flutter apps use the
Runnerscheme by default
E2E Testing (Maestro MCP)
For cross-platform E2E testing, use the maestro MCP server. It runs test flows on both iOS simulator and Android emulator from natural language prompts.
When to Use Which Test Tool
| Test Type | Tool | When |
| Widget/unit tests | flutter test (Bash) or dart-mcp-server run_tests | Every feature — fast, isolated, no device needed |
| iOS build + quick visual check | xcodebuild MCP (build_run_sim, screenshot) | Spot-checking a screen during development |
| Repeatable E2E flows | maestro MCP | Login, checkout, CRUD journeys — saved and rerunnable |
| Cross-platform E2E | maestro MCP | Same YAML flow runs on iOS simulator AND Android emulator |
| CI/CD regression suite | maestro test test/e2e/ (Bash) | Pre-merge gate in GitHub Actions |
E2E Workflow
1. Build and launch app (XcodeBuildMCP for iOS, flutter run for Android)
2. Describe the test flow in natural language
3. Claude generates YAML via Maestro MCP and runs it
4. Claude reports pass/fail per step
5. Save generated YAML to test/e2e/<flow-name>.yaml for reuseFlow File Conventions
- Save flows to
test/e2e/at the project root - Name files by user journey:
login-flow.yaml,create-workout-flow.yaml - Use
appIdmatching your app's bundle ID - One flow per file — keep flows focused on a single journey
Gotchas
- App must be running: Maestro interacts with a live app — build and launch first
- Accessibility labels: Maestro finds elements by text and accessibility labels — ensure
Semanticswidgets have labels - Timing: Use
waitForAnimationToEndorextendedWaitUntilfor slow transitions, not hardcoded sleeps - Cross-platform element names: iOS and Android may render text differently — use
idattributes for reliable cross-platform selectors
Common Commands
flutter run # Run on connected device/emulator
flutter test # Run tests
flutter build apk # Build Android APK
flutter build ios # Build iOS (also generates Xcode project)
flutter pub get # Install dependencies
flutter clean # Clean build artifacts
dart run build_runner build --delete-conflicting-outputs # Run code generation
flutter analyze # Static analysisError Handling
Build runner fails: Delete .dart_tool/build/, run flutter clean, retry codegen
Missing generated files: Ensure part directives match filename (e.g., part 'user_model.g.dart';)
Provider not found: Run dart run build_runner build, import generated .g.dart file
Firestore Timestamp errors: Use (data['createdAt'] as Timestamp).toDate() in fromFirestore
Hot reload breaks state: Restart app fully when changing provider signatures
AsyncValue stuck loading: Check repository returns data, use AsyncValue.guard() to catch errors
Hard Prohibitions
- No
Navigator.pushwith raw strings — use GoRouter type-safe routes exclusively - No returning null on async error — use
AsyncValue.error, never null/empty fallbacks - No
Color(0x...)orColors.*— useTheme.of(context).colorScheme.* - No raw
EdgeInsetswith numeric values — useAppSpacing.*tokens - No inline
TextStyle(fontSize: ...)— useTheme.of(context).textTheme.*
Sealed Types vs Boolean Flag Soup
Anti-pattern — boolean flags that create invalid states:
// ❌ 4 booleans = 16 possible states, most invalid
class LoadState {
bool isLoading = false;
bool isError = false;
bool isEmpty = false;
bool isSuccess = false;
// isLoading=true AND isSuccess=true is invalid but representable
}Correct — sealed class makes invalid states unrepresentable:
// ✅ Dart 3 sealed class — exactly 4 valid states
sealed class LoadState<T> {}
final class LoadingState<T> extends LoadState<T> {}
final class ErrorState<T> extends LoadState<T> {
final Object error;
final StackTrace? stack;
ErrorState(this.error, [this.stack]);
}
final class EmptyState<T> extends LoadState<T> {}
final class SuccessState<T> extends LoadState<T> {
final T data;
SuccessState(this.data);
}
// Usage — exhaustive pattern matching (compiler enforces all cases):
Widget build(BuildContext context) {
return switch (state) {
LoadingState() => const CircularProgressIndicator(),
ErrorState(:final error) => ErrorWidget(error.toString()),
EmptyState() => const Text('No items'),
SuccessState(:final data) => ItemList(data),
};
}Rule: Use sealed classes + switch expressions for any state with 3+ mutually exclusive cases. Applies to: UI state, network state, auth state, form state.
Applies to: Flutter 3.41.x / Dart 3.10.9+ (sealed classes require Dart 3.0+)
State Management Quick Reference
Library-agnostic comparison (for Riverpod-specific patterns, see .claude/skills/riverpod-patterns/):
| Library | Best for | Avoid when |
| Riverpod | Complex apps, DI, testability | Simple apps — overhead not justified |
| Bloc | Team environments, strict separation, audit-ready | Solo devs — too much boilerplate |
| Provider | Simple state, migration path from InheritedWidget | New projects — use Riverpod instead |
| GetX | Rapid prototyping | Production apps — couples UI to logic |
| flutter_hooks | Functional widget style, reusable stateful logic | Mixed teams unfamiliar with hooks |
| setState | Local ephemeral UI state (single widget) | Shared state across widgets |
| InheritedWidget | Framework/library authors only | App code — use Provider/Riverpod |
This workspace's stack uses Riverpod — see .claude/skills/riverpod-patterns/ for detailed patterns.
Post-Code Review
After writing Dart code, dispatch these reviewer agents:
riverpod-reviewer— state management, provider types, AsyncValue handlingflutter-security-expert— secure storage, certificate pinning, data protectionaccessibility-auditor— WCAG 2.1 compliance, Semantics widgets, touch targets
Pre-submit checks (smart/dumb pattern):
shared_ui/widgets extendStatelessWidget— zero ref/ConsumerWidget usageref.watch()only inConsumerWidgetbuild();ref.read()only in callbacks
Templates Reference
For all code templates (pubspec.yaml, Freezed models, Riverpod providers, screen widgets, GoRouter config, widget tests, Firebase integration, repository patterns):
Read reference/flutter-templates.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

