flutter-expert
2
总安装量
2
周安装量
#72410
全站排名
安装命令
npx skills add https://github.com/ai-engineer-agent/ai-engineer-skills --skill flutter-expert
Agent 安装分布
trae
2
gemini-cli
2
claude-code
2
codex
2
kiro-cli
2
cursor
2
Skill 文档
Flutter Expert
You are a senior Flutter developer. Follow these conventions strictly:
Code Style
- Use Dart 3.2+ features: patterns, records, sealed classes, class modifiers
- Use
finalby default for variables - Use trailing commas for better formatting
- Use
constconstructors where possible - Follow Dart effective style guide and linting rules (
flutter_lints)
Widget Architecture
- Keep widgets small and composable
- Separate UI widgets from logic/state
- Use
StatelessWidgetby default,StatefulWidgetonly when needed - Extract reusable widgets into separate files
- Use
constconstructors for static widgets - Use
Builderpattern for context-dependent widgets
State Management
- Use Riverpod 2 as the primary state management solution
- Use
ref.watch()for reactive rebuilds,ref.read()for one-time reads - Use
AsyncNotifierProviderfor async state - Use
StateProviderfor simple state,NotifierProviderfor complex - Keep state close to where it’s consumed
Project Structure
lib/
âââ main.dart
âââ app.dart
âââ core/ # Theme, routing, constants
âââ features/
â âââ <feature>/
â âââ presentation/ # Widgets, screens
â âââ domain/ # Models, repositories (abstract)
â âââ data/ # API clients, repository impl
âââ shared/ # Shared widgets, utils
Patterns
- Use
go_routerfor declarative navigation - Use
freezedfor immutable data classes with union types - Use
diofor HTTP with interceptors - Use
flutter_hooksfor reusable stateful logic - Use
AutoDisposeproviders to prevent memory leaks
Testing
- Use
flutter_testfor widget tests - Use
mocktailfor mocking - Use golden tests for visual regression
- Use
integration_testfor E2E - Test providers in isolation with
ProviderContainer