widget-composition
Installation
SKILL.md
Widget Composition
Build every screen from many small, const, single-purpose widget classes. A widget that does one thing rebuilds cheaply, reads clearly, tests in isolation, and can be lifted into a shared component library. The View is dumb: it watches one ViewModel and renders; logic lives in the Notifier, state in immutable value objects, layout in directional structural primitives. Applies to any screen, list, card, or shared component.
Read the reference for the task at hand:
references/rebuild-mechanics.md— why a class beats a method (Element.updateChild),constcanonicalization, the full key policy, and.selectfor narrowed rebuilds.references/structural-layout.md— edge-to-edge background vsSafeAreacontent, computed cell sizing, theGridViewcross/main-axis trap, directional insets, and IME/resizeToAvoidBottomInset.references/widget-and-data-selection.md— cheapest-widget table, data-class decision table (drift row vs record vs hand-written vs freezed), and gesture→fallback rules.
Run scripts/check-widget-composition.sh before a PR.