← Tous les modèles

Widgets sans logique, état centralisé, golden tests pour les écrans clés.

Constitution — Flutter app

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.

  1. Widgets stay dumb. A build method renders state and forwards events. Widgets make no network, storage or platform calls; that work lives in classes that are tested without Flutter.

  2. State lives in one place. The plan picks one state management approach, such as Riverpod or Bloc, and the whole app uses it. setState is only for local, short-lived UI state like an animation flag.

  3. Golden tests for key screens. Key screens have golden tests with matchesGoldenFile in light and dark themes and at a large text scale. A changed golden is reviewed as an image before the merge.

  4. Clean analysis. flutter_lints or a stricter set is enabled and flutter analyze reports zero issues in CI. Null safety is never bypassed with ! without a reason in the review.

  5. Smooth frames. Widgets use const constructors where they can and long lists use ListView.builder. Key scrolls are profiled in profile mode, and frames over 16 ms on the reference device are a defect.

  6. Accessible by default. Custom controls have Semantics labels, tap targets are at least 48 by 48, and layouts work at a text scale of 200%. Screens are checked with VoiceOver and TalkBack.

  7. Typed platform channels. Calls to native code go through Pigeon-generated APIs. Untyped MethodChannel calls with string method names fail the review.