1---2name: li-lance-android-seraphim-framework-flutter-widgets3description: UI & Widgets4---56# UI & Widgets78## **Priority: P1 (OPERATIONAL)**910Standards for building reusable, performant Flutter widgets and UI components.1112- **State**: Use `StatelessWidget` by default. `StatefulWidget` only for local state/controllers.13- **Composition**: Extract UI into small, atomic `const` widgets.14- **Theming**: Use `Theme.of(context)`. No hardcoded colors.15- **Layout**: Use `Flex` + `Gap/SizedBox`.16- **Widget Keys**: All interactive elements must use keys from `widget_keys.dart`.17- **File Size**: If a UI file exceeds ~80 lines, extract sub-widgets into private classes.18- **Specialized**:19 - `SelectionArea`: For multi-widget text selection.20 - `InteractiveViewer`: For zoom/pan.21 - `ListWheelScrollView`: For pickers.22 - `IntrinsicWidth/Height`: Avoid unless strictly required.23- **Large Lists**: Always use `ListView.builder`.2425```dart26class AppButton extends StatelessWidget {27 final String label;28 final VoidCallback onPressed;29 const AppButton({super.key, required this.label, required this.onPressed});3031 @override32 Widget build(BuildContext context) => ElevatedButton(onPressed: onPressed, child: Text(label));33}34```3536## Anti-Patterns3738- ❌ `setState(() { _orders = await repo.fetch(); })` — server/shared state belongs in a BLoC, not39 widget state40- ❌ Widget file over 80 lines without extracting private sub-widget classes — helper methods41 returning `Widget` are not a substitute42- ❌ `Key('submit-button')` inline in widget code — all keys must be constants defined in43 `widget_keys.dart`44- ❌ `Widget _buildHeader() { … }` helper methods — extract to a `const` `StatelessWidget` private45 class for proper rebuilding control4647## Related Topics4849performance | testing5051---52> Source: [li-lance/android-seraphim-framework](https://github.com/li-lance/android-seraphim-framework) — distributed by [TomeVault](https://tomevault.io).53<!-- tomevault:4.0:skill_md:2026-06-16 -->
Run npx skillmds@latest add tomevault-io/li-lance-android-seraphim-framework-flutter-widgets in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
UI & Widgets It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.