flutter-expert

SKILL.md

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 final by default for variables
  • Use trailing commas for better formatting
  • Use const constructors 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 StatelessWidget by default, StatefulWidget only when needed
  • Extract reusable widgets into separate files
  • Use const constructors for static widgets
  • Use Builder pattern 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 AsyncNotifierProvider for async state
  • Use StateProvider for simple state, NotifierProvider for 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_router for declarative navigation
  • Use freezed for immutable data classes with union types
  • Use dio for HTTP with interceptors
  • Use flutter_hooks for reusable stateful logic
  • Use AutoDispose providers to prevent memory leaks

Testing

  • Use flutter_test for widget tests
  • Use mocktail for mocking
  • Use golden tests for visual regression
  • Use integration_test for E2E
  • Test providers in isolation with ProviderContainer
Weekly Installs
4
First Seen
Feb 24, 2026
Installed on
opencode4
gemini-cli4
claude-code4
codex4
kiro-cli4
cursor4