agentleFS
TheBeardedBearSASTheBeardedBearSAS/claude-craft/.claude/references/flutter/CLAUDE.md

claude-craft / flutter

CLAUDE.md106 starsChanged 4 months agoMITView on GitHub

Sources : Flutter 3.44 Blog, Dart 3.12 Blog Source : Impeller performance gains Source : Dart 3.12 Wasm Source : Dart 3.11 Blog Agentic Hot Reload (Dart 3.12): Le Dart & Flutter MCP Server permet aux agents IA (Claude Code, Cursor) de déclencher automatiquement le hot reload après chaque modification, sans copie manuelle d'URI. Source : Dart 3.12 Blog Sources : Riverpod — What's New | pub.dev/packages/flutter_riverpod

The file

Files
CLAUDE.md

Flutter 3.44+ / Dart 3.12+ - Quick Reference

Versions Requises (2026)

ComposantVersion
Flutter3.44+
Dart3.12+
DevTools2.42+
Android SDK35+
iOS15.0+
Xcode16.0+

Sources : Flutter 3.44 Blog, Dart 3.12 Blog

Architecture Clean

lib/
├── core/               # Constantes, erreurs, utils, theme
├── features/           # Modules métier
│   └── [feature]/
│       ├── data/       # Datasources, models, repos impl
│       ├── domain/     # Entities, repos interface, usecases
│       └── presentation/  # BLoC/Riverpod, pages, widgets
├── dependency_injection.dart
└── main.dart

Nouvelles Features 2026

Dart 3.11 Dot Shorthands & Patterns

// Avant
if (status == OrderStatus.active) { }

// Dart 3.11+
if (status == .active) { }

// Switch expressions
final label = status switch {
  .pending => 'En attente',
  .active => 'Actif',
  _ => 'Autre',
};

// Lint simplify_variable_pattern (Dart 3.11)
// Avant: switch(value) { case var x: ... }
// Après: switch(value) { case _: ... }

Impeller par défaut (Flutter 3.44)

# Activé par défaut sur iOS et Android (−50% rastérisation)
# Désactiver uniquement si nécessaire:
flutter:
  uses-impeller: false  # Déconseillé

Source : Impeller performance gains

WebAssembly (Wasm) & dart:js_interop

# Build Wasm (2-3x plus rapide)
flutter build web --wasm

# Dev avec Wasm
flutter run -d chrome --wasm
// dart:js_util SUPPRIMÉ en Wasm
// Utiliser dart:js_interop
import 'dart:js_interop';

@JS()
external void myJsFunction();

Source : Dart 3.12 Wasm

Material 3 Modulaire

// Packages indépendants pour Material 3
import 'package:material_color_utilities/material_color_utilities.dart';

Pub Workspaces avec Globs (Dart 3.11)

# pubspec.yaml
workspace:
  - packages/*
  - tools/**  # Glob support

Source : Dart 3.11 Blog

Unix Domain Sockets (Windows, Dart 3.11)

// Désormais supporté sur Windows
final socket = await Socket.connect(
  InternetAddress.fromRawAddress([0], type: InternetAddressType.unix),
  0,
);

Dart 3.12 Features

// (a) Primary constructors (expérimental)
class Point(final int x, final int y);
// Activer : --enable-experiment=primary-constructors

// (b) Private named parameters
class Hummingbird {
  final String _petName;
  final int _wingbeatsPerSecond;
  Hummingbird({required this._petName, required this._wingbeatsPerSecond});
}
// Appel : Hummingbird(petName: 'Dash', wingbeatsPerSecond: 75)
// Le _ dans le champ → paramètre nommé public à l'appel

Agentic Hot Reload (Dart 3.12): Le Dart & Flutter MCP Server permet aux agents IA (Claude Code, Cursor) de déclencher automatiquement le hot reload après chaque modification, sans copie manuelle d'URI. Source : Dart 3.12 Blog

State Management

// Riverpod 3.0 Mutations API (recommandé)
@riverpod
class OrderNotifier extends _$OrderNotifier {
  @override
  FutureOr<Order?> build(String id) => fetchOrder(id);
  
  // Pas de state.mutation() — les Mutations sont des objets top-level
  // Voir state-management.md pour l'API Riverpod 3.0 Mutations correcte
}

Sources : Riverpod — What's New | pub.dev/packages/flutter_riverpod

// BLoC v9: mounted safety checks
class OrderBloc extends Bloc<OrderEvent, OrderState> {
  OrderBloc() : super(OrderInitial()) {
    on<LoadOrder>(_onLoadOrder);
  }
  
  // BLoC v9: vérification automatique si le bloc est actif
  Future<void> _onLoadOrder(LoadOrder event, Emitter<OrderState> emit) async {
    if (emit.isDone) return;  // BLoC v9: Emitter.isDone (isMounted n'existe pas)
    emit(OrderLoading());
    // ...
  }
}

Source : BLoC v9 changelog

Commandes

# Build
flutter build apk --release
flutter build ios --release
flutter build web --wasm

# Tests
flutter test
flutter test --coverage

# Analyse
flutter analyze
dart fix --apply

# Code generation
dart run build_runner build -d

Documentation Complète

  • project-context.md - Contexte projet
  • coding-standards.md - Standards Dart 3.12+
  • wasm.md - WebAssembly
  • mcp-integration.md - Model Context Protocol
  • web-performance-2026.md - Performance web

Checklist Rapide

  • Flutter 3.44+, Dart 3.12+
  • Dot shorthands utilisés (Dart 3.11)
  • Impeller activé (par défaut)
  • dart:js_interop pour Wasm (pas dart:js_util)
  • const partout où possible
  • Trailing commas
  • Tests >= 80% coverage
  • Web: Wasm build pour prod
  • BLoC v9: emit.isDone checks (Emitter) / isClosed checks (Cubit)
  • Riverpod 3: Mutations API pour async

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.