Flutter Screen Architecture
Builds Flutter screens from small themed widgets that fit any screen width and avoid common layout errors.
Claude's review
7/10 Practical Flutter rules with current API deprecations, width based layout and a useful catalogue of common layout errors and their fixes.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use when building Flutter screens - compose small stateless widgets, keep layout declarative, decide layout by available width not device/orientation, separate presentation from business logic, and use the theme not hardcoded styles
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: flutter-widget-architecture
category: architecture
description: Use when building Flutter screens - compose small stateless widgets, keep layout declarative, decide layout by available width not device/orientation, separate presentation from business logic, and use the theme not hardcoded styles
tech_stack: Flutter
source: flutter/agent-plugins (BSD-3-Clause), adapted
---
# Flutter Widget Architecture
## Overview
Flutter UI is a tree of widgets. The quality difference is in decomposition: small, focused, mostly-stateless widgets that read like the UI they render, with business logic pushed out of the widget tree.
**Core principle:** Widgets describe what the UI looks like given state. They do not fetch data, hold business rules, or talk to the network — that lives in state/services (see flutter-state-management).
## Rules
- **Prefer `StatelessWidget`.** Reach for `StatefulWidget` only for truly local, ephemeral UI state (an animation controller, a text field's focus). App/business state lives in your state management layer.
- **Small widgets over deep `build` methods.** A `build` longer than ~40 lines or nested 5+ deep is a set of extract-widget opportunities. Extract named widgets, not `Widget _buildX()` helper methods (named widgets get their own rebuild scope and are testable).
- **`const` constructors everywhere possible** — a `const` widget subtree is skipped on rebuild. This is the cheapest performance win in Flutter.
- **Theme, not hardcoded styles.** Colors, text styles, spacing come from `Theme.of(context)` / a design-token file (`context.space`, see `mobile-design-system-foundation`) — never scattered `Color(0xFF...)` and magic paddings. This is the Flutter equivalent of "no custom CSS."
- **Keys** only when you need identity across rebuilds (reorderable lists) — don't sprinkle them.
- **Decide layout by available width, not device type or orientation.** Use `LayoutBuilder` or `MediaQuery.sizeOf(context)` — never `MediaQuery.of(context).size` (that rebuilds on every metric change, not just size) and never a device-type/orientation check to pick a layout. See `adaptive-layout` and `mobile-visual-self-review` for the size matrix this must hold at.
- **`Color.withValues(alpha:)`**, not the deprecated `withOpacity` (precision loss). **`TextScaler`** (`MediaQuery.textScalerOf(context).scale(...)`), not the deprecated `textScaleFactor`.
## Worked Example
```dart
// ❌ one giant build, hardcoded style, logic in the widget
Widget build(BuildContext context) {
return Container(padding: EdgeInsets.all(16), color: Color(0xFF2196F3),
child: Column(children: [ Text(task.title, style: TextStyle(fontSize: 18)), /* 60 more lines */ ]));
}
// ✅ composed from small const widgets, themed, logic elsewhere
class TaskCard extends StatelessWidget {
const TaskCard({super.key, required this.task});
final Task task;
@override
Widget build(BuildContext context) => Card(
...From makifbaysal's repository, Apache-2.0 licence.
Related skills
-
Checked
Android Gradle Plugin upgrade
Moves Kotlin Multiplatform projects to Android Gradle Plugin 9 and fixes the build failures it causes.
8/101 credit -
Checked
CocoaPods to SwiftPM
Moves Kotlin Multiplatform projects from CocoaPods to Swift Package Manager and updates the Xcode project.
8/101 credit -
Checked
Kotlin Native build speed
Diagnoses and fixes slow Kotlin/Native iOS builds in Kotlin Multiplatform projects, both locally and on CI.
7/101 credit -
Checked
SwiftUI Liquid Glass
Adds and reviews Liquid Glass in SwiftUI apps for iOS 26, avoiding pitfalls with bars, buttons and scrolling.
7/101 credit -
Checked
Native Mobile App Design
Designs Expo and React Native screens that feel truly native, with proper navigation, motion and dark mode.
7/101 credit -
Checked
EAS cloud simulators
Runs your app on Expo's cloud iOS and Android simulators, so you can test without a local simulator.
7/101 credit