Widgets stay dumb, state lives in one place, golden tests for key screens.
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.
-
Widgets stay dumb. A
buildmethod renders state and forwards events. Widgets make no network, storage or platform calls; that work lives in classes that are tested without Flutter. -
State lives in one place. The plan picks one state management approach, such as Riverpod or Bloc, and the whole app uses it.
setStateis only for local, short-lived UI state like an animation flag. -
Golden tests for key screens. Key screens have golden tests with
matchesGoldenFilein light and dark themes and at a large text scale. A changed golden is reviewed as an image before the merge. -
Clean analysis.
flutter_lintsor a stricter set is enabled andflutter analyzereports zero issues in CI. Null safety is never bypassed with!without a reason in the review. -
Smooth frames. Widgets use
constconstructors where they can and long lists useListView.builder. Key scrolls are profiled in profile mode, and frames over 16 ms on the reference device are a defect. -
Accessible by default. Custom controls have
Semanticslabels, tap targets are at least 48 by 48, and layouts work at a text scale of 200%. Screens are checked with VoiceOver and TalkBack. -
Typed platform channels. Calls to native code go through Pigeon-generated APIs. Untyped
MethodChannelcalls with string method names fail the review.