From flutter
Production Flutter/Dart development: architecture scaffolds, Riverpod/BLoC, GoRouter, Freezed, testing, CI/CD gates, platform build fixes. Trigger only on a Flutter/Dart signal — pubspec.yaml present or explicit Flutter/Dart mention.
How this skill is triggered — by the user, by Claude, or both
Slash command
/flutter:flutter-expertThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Opinionated patterns for shipping production Flutter apps.
Opinionated patterns for shipping production Flutter apps.
Verify versions against the live project before copying any snippet. Nothing here pins versions: add packages with
flutter pub add <pkg>(-dfor dev deps) and verify current majors on pub.dev. Snippets assume current majors: Riverpod 3, freezed 3, go_router 16, flutter_lints 6, Dart 3.
Read the relevant file before writing detailed code.
| Topic | File |
|---|---|
| Scaffolds (small/medium/large/monorepo), DI, flavors, Failure hierarchy, migration | reference/architecture-patterns.md |
| Riverpod 3, BLoC/Cubit, Provider, comparison matrix | reference/state-management.md |
| App entry point, Dio ApiClient, Freezed, repository, GoRouter, forms, responsive, widgets, tests, i18n | reference/code-templates.md |
| Lint rules, CI/CD, coverage, pre-commit, release signing, profiling | reference/quality-gates.md |
Run only for new projects or unknown environments; skip for targeted edits in an already-inspected project.
flutter doctor -v
if [ -f "pubspec.yaml" ]; then
head -40 pubspec.yaml
ls lib/ lib/features/ lib/core/ 2>/dev/null
fi
Identify: Flutter/Dart version, architecture, state management in use, target platforms.
Recommend by scope; don't ask the user to pick:
Every feature: data/(datasources|models|repositories), domain/(entities|repositories|usecases), presentation/(providers|screens|widgets). Scaffold scripts and the app entry point live in the references.
| Signal | Choose |
|---|---|
| Local form/toggle state in one widget | setState |
| Shared state across widgets | Riverpod 3 |
| Complex async flows (auth, pagination, real-time) | Riverpod 3 AsyncNotifier |
| Event-driven, team mandates BLoC | flutter_bloc |
| Legacy Provider project | keep Provider unless rewriting |
domain (pure Dart contract) → data (models, datasources, repository impl) → presentation (one provider per screen) → routing (register + guards) → tests (unit domain → unit data → widget → integration). Templates: reference/code-templates.md.
Failure hierarchy (architecture-patterns.md § Medium Project).ApiClient with flavor-gated logging and 401-refresh interceptor (code-templates.md § Network Layer).code-templates.md § Navigation).const constructors everywhere; RepaintBoundary around animated widgets; ListView.builder for dynamic lists; cacheWidth/cacheHeight or cached_network_image; check mounted after every await before using context; ValueKey on reorderable list items; compute()/Isolate.run() for JSON >1MB or image work.Before marking any task complete:
dart analyze --fatal-infos
dart format --set-exit-if-changed .
flutter test --coverage
flutter build apk --debug 2>&1 | tail -5
Full CI pipeline, lint set, release signing: reference/quality-gates.md.
NS*UsageDescription strings for every permission; CocoaPods fix: cd ios && pod deintegrate && pod install --repo-update.minSdk 23+, current compileSdk; namespace = "com.example.app" in build.gradle.kts; multidex if >64K methods.flutter clean && rm -rf pubspec.lock .dart_tool build ios/Pods ios/Podfile.lock && flutter pub get| Symptom | Fix |
|---|---|
setState() called after dispose() | check mounted before setState |
| Widget rebuild storms | add const, check provider scoping |
| "Looking up deactivated widget's ancestor" | check mounted after await |
| Jank on scroll | flutter run --profile, add RepaintBoundary |
| "Connection refused" on Android emulator | use 10.0.2.2 not localhost |
| iOS "module not found" | cd ios && pod install --repo-update |
| Gradle failure | check gradle-wrapper.properties version |
| "type 'Null' is not a subtype" | trace the nullable chain |
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub nalyk/nalyk-skills