AgentLint Verified 89/10055 Dart / Flutter repos analyzed

    Dart / Flutter CLAUDE.md & AGENTS.md Template

    flutter test filters, dart analyze strictness, and widget testing rules from Dart/Flutter repos.

    # Dart / Flutter Project — Dart / Flutter Harness
    
    Flutter application verified with `dart analyze`, `dart format`, and targeted widget/unit tests.
    
    ## Commands
    
    - Fast single test: `flutter test test/unit/target_test.dart`
    - Full tests: `flutter test`
    - Analyze & format: `dart analyze --fatal-infos && dart format --output=none --set-exit-if-changed .`
    - Codegen: `dart run build_runner build --delete-conflicting-outputs`
    
    ## Rules
    
    - Don't hand-edit `*.g.dart` or `*.freezed.dart` files. Instead update the source model and re-run `build_runner`. Because manual edits get wiped on the next build.
    - Don't skip `dart analyze --fatal-infos` before committing. Because analyzer infos frequently catch unawaited futures and disposed controller leaks.
    - When modifying navigation or state providers, read `docs/state-architecture.md`.
    
    ## Continuity
    
    - Keep signing keys, `.env`, and `CLAUDE.local.md` out of git and record UI test evidence in `HANDOFF.md`.

    Most Adopted Dart / Flutter Rules Across Real Open-Source Repos

    Measured across 55 public Dart / Flutter repositories in the 4,533-repo harness study:

    flutterframework

    Flutter framework

    66.7%30 repos
    flutter-testtesting

    flutter test for testing

    42.2%19 repos
    providerpatterns

    Provider for state management

    37.8%17 repos
    unit-teststesting

    Write unit tests for all changes

    37.8%17 repos
    error-handlingpatterns

    Proper error handling with context

    35.6%16 repos
    ci-cdtooling

    CI/CD pipeline must pass

    28.9%13 repos
    riverpodtooling

    Riverpod for state management

    28.9%13 repos
    material-designpatterns

    Material Design widgets

    26.7%12 repos
    Essential Commands (Checks W1 & W7)
    install
    flutter pub get
    fastTest
    flutter test test/unit/target_test.dart
    fullTest
    flutter test
    lint
    dart analyze --fatal-infos && dart format --output=none --set-exit-if-changed .
    build
    flutter build web
    Common Dart / Flutter Agent Pitfalls
    • 01Agents edit generated .g.dart / .freezed.dart files by hand instead of running build_runner.
    • 02Deep nested widget trees without const constructors degrade frame times.

    More Verified Stack Templates