Home › Flutter › Flutter AGENTS.md
Flutter AGENTS.md
AGENTS.md for Flutter apps with Riverpod, go_router and clean feature-first structure.
AGENTS.mdFlutter
How to use
Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.
AGENTS.mdDownload # AGENTS.md — Flutter
## Commands
- `flutter pub get` · `dart format .` · `flutter analyze` · `flutter test`
- Codegen (freezed/json_serializable/riverpod_generator): `dart run build_runner build -d`
## Structure
- Feature-first: `lib/features/<feature>/{data,domain,presentation}`; shared code in `lib/core`.
## Rules
- State management: Riverpod (with code generation). No `setState` beyond purely local widget state.
- Navigation: go_router with typed routes.
- Immutable models with `freezed`; never mutate state objects in place.
- Prefer `const` constructors; split widgets into small classes rather than helper methods returning widgets.
- Never block the UI thread; heavy work goes to `compute`/isolates.
- Respect platform conventions (back gestures, safe areas, text scaling). All tappables need semantics labels.
- Don't edit generated `*.g.dart` / `*.freezed.dart` files.
## Done
- `flutter analyze` has zero issues and `flutter test` passes.