flutter
Skill1 starsChanged 4 months agoMITView on GitHub
Flutter/Dart-specific expertise — `build()` as a pure, cheap, frequently-called function (no side effects, no Future creation, no controller construction), `const` constructors and narrow rebuild scope for performance, `StatefulWidget` lifecycle and disposing controllers/streams/subscriptions, the `mounted` check after every `await`, matching the project's existing state management instead of introducing a second one, the constraints-down/sizes-up layout model and the unbounded-constraint errors it produces, `ListView.builder` for long or infinite lists, async UI (`FutureBuilder`/`StreamBuilder` done correctly), navigation/context pitfalls, and platform channels, assets, and permissions declared per platform. Use when `pubspec.yaml` exists, when the work is in `lib/**.dart` or touches `MaterialApp`/widgets, or when asked directly (Thai or English) to สร้างหรือแก้ไขแอป Flutter / เขียนโค้ด Dart. Not a replacement for frontend-dev's web-framework UI work — Flutter is a separate rendering model, so react/html-css/tailwind rules do not carry over; ui-ux-researcher's interaction/layout recommendations still do.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- Evan-Kim2028/agent-skillstheir own version, first seen Aug 16, 2026
- guocheng1378/android-reverse-skillstheir own version, first seen Aug 6, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Jul 14, 2026
- alinaqi/maggytheir own version, first seen Jun 12, 2026
- nguyenchilong/claude-skills-fullstackstheir own version, first seen May 22, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- alinaqi/maggy★ 707same name
- Mindrally/skills★ 266same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- guocheng1378/android-reverse-skills★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- Evan-Kim2028/agent-skills★ 1same name
- nguyenchilong/claude-skills-fullstacks★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agent-flowSkill
- dev-testingSkill
- dry-and-corSkill
- electronSkill
- firebaseSkill
- google-authSkill
- html-cssSkill
- mysqlSkill
- nodejsSkill
- postgresSkill
- reactSkill
- sqliteSkill
- stack-briefingSkill
- supabaseSkill
- tailwindSkill
- tursoSkill
- typescriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 4 are distinctive, and 19 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
19
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Check for pubspec.yaml, lib/main.dart, android/+ios/ folders, or .dart sources.
- Very specific: line 33
Never create a Future inside build() and hand it to a FutureBuilder — a rebuild creates a new Future and refetches, which is the classic …
- Very specific: line 37
Never construct controllers (TextEditingController, AnimationController, ScrollController) in build() — they'd be recreated and leaked.
- Very specific: line 45
Use const constructors everywhere they're possible — a const widget subtree is skipped entirely on rebuild.
- Very specific: line 48
Prefer composition into small widgets over one 400-line build() with helper methods returning widgets: a separate widget class can be const …
- Very specific: line 68
After every await in a State method, check if (!mounted) return.
- Very specific: line 71
Don't hold a BuildContext across an async gap.
- Very specific: line 94
Use MediaQuery/LayoutBuilder for responsive breakpoints and SafeArea for notches and system bars.
- Very specific: line 108
Keep business logic and API access out of widgets — a repository/service layer keeps build() free of network code and makes the logic …
- Very specific: line 119
Never store tokens or secrets in shared_preferences — use flutter_secure_storage, and keep API secrets on a server.
- Very specific: line 125
Every asset must be declared in pubspec.yaml.
- Distinctive: line 135
Test on a real profile/release build for performance claims — debug builds are slow by construction, so "it janks in debug" is not a …
- Very specific: line 160
Don't do side effects, network calls, or Future creation inside build(), and don't build controllers there.
- Very specific: line 162
Don't skip const, or replace small widget classes with _buildSomething() helpers that always rebuild.
- Very specific: line 164
Don't call setState at the top of a screen for a change that affects one small widget.
- Distinctive: line 166
Don't leave a controller, stream subscription, or timer undisposed.
- Very specific: line 167
Don't use context or call setState after an await without checking mounted.
- Very specific: line 169
Don't fix an overflow by hardcoding sizes, or a ListView in a Column by reaching for shrinkWrap on a long list.
- Very specific: line 171
Don't build a long list with ListView(children: [...]).
- Distinctive: line 172
Don't introduce a second state-management or routing library alongside the project's existing one without saying so.
- Very specific: line 174
Don't store secrets or tokens in shared_preferences, and don't embed API secrets in the app at all.
- Distinctive: line 176
Don't judge performance from a debug build.
- Very specific: line 177
Don't carry web assumptions over — there is no DOM, no CSS, and skills/react/SKILL.md/skills/html-css/SKILL.md/ skills/tailwind/SKILL.md …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter
The mobile/desktop UI lane. Flutter does not use the DOM or CSS, so
skills/html-css/SKILL.md, skills/react/SKILL.md, and
skills/tailwind/SKILL.md do not apply — none of their mechanisms
exist here. What does carry over is ui-ux-researcher's interaction and
information-architecture work, the API contracts backend-dev states, and
the verification discipline in skills/dev-testing/SKILL.md (a widget that
renders while throwing in the console is still a failure).
Step 1 — Confirm Flutter and read the project's conventions
Check for pubspec.yaml, lib/main.dart, android/+ios/ folders, or
.dart sources. Then read, before writing anything: the Dart SDK and
Flutter constraints in pubspec.yaml, whether null safety is on (it is, on
any modern SDK), the state management already in use
(setState only, Provider, Riverpod, Bloc/Cubit, GetX), the navigation
approach (Navigator 1.0, go_router), and the lint set in
analysis_options.yaml. Introducing a second state-management or routing
library into a project that already has one is a structural change, not an
implementation detail — say so instead of doing it silently.
Step 2 — build() is pure, cheap, and called often
build()can run on every frame. It may only read state and return widgets: no network calls, nosetState, no file I/O, no analytics events, noSharedPreferenceswrites.- Never create a
Futureinsidebuild()and hand it to aFutureBuilder— a rebuild creates a new Future and refetches, which is the classic infinite-loading/flicker bug. Create it ininitState(or in the state layer) and store it. - Never construct controllers (
TextEditingController,AnimationController,ScrollController) inbuild()— they'd be recreated and leaked. They belong ininitState, disposed indispose(). - Widgets are immutable descriptions, not retained objects; treat constructing them as free and the work inside them as the cost.
Step 3 — Widget structure and rebuild scope
- Use
constconstructors everywhere they're possible — aconstwidget subtree is skipped entirely on rebuild. The linter flags most of these; don't suppress it. - Prefer composition into small widgets over one 400-line
build()with helper methods returning widgets: a separate widget class can beconstand rebuilds independently, while_buildHeader()always rebuilds with its parent. setStaterebuilds the wholeStatesubtree — push it down to the smallest widget that owns the changing value rather than calling it at the top of a screen.- Give stateful list items stable
Keys (aValueKeyfrom the model's id) when the list can reorder, filter, or splice — otherwise element state attaches to the wrong row, the same failure mode as index keys in React. StatelessWidgetunless there is genuinely local mutable state; local UI state (a toggle, a text field) belongs in the widget, shared/business state belongs in the project's state layer.
Step 4 — Lifecycle, disposal, and async safety
- Everything created in
initStateis released indispose(): controllers,StreamSubscriptions, timers, focus nodes, platform listeners. An undisposed subscription keeps firing after the screen is gone and throws onsetStateafter unmount. - After every
awaitin aStatemethod, checkif (!mounted) return;before callingsetStateor usingcontext. The user can navigate away mid-request, and "setState called after dispose" is exactly this. - Don't hold a
BuildContextacross an async gap; capture what you need (aScaffoldMessenger, aNavigator) before theawaitinstead — theuse_build_context_synchronouslylint exists for this. - Handle errors on every
Futureshown to a user: an unhandled exception becomes a red error widget in debug and a silent broken screen in release. SetFlutterError.onError/PlatformDispatcher.instance.onErrorfor reporting. didChangeDependencies(notinitState) for work depending on inherited widgets;didUpdateWidgetwhen a parent passes new configuration.
Step 5 — Layout: constraints go down, sizes go up
- A parent passes constraints down; a child picks its size within them; the
parent positions it. Most layout errors are one of:
- "Unbounded height/width" — a
Columninside aSingleChildScroll View/anotherColumngiving aListViewinfinite height. Fix withExpanded/Flexible,shrinkWrap: true(only for small lists), or aSizedBoxwith a real height. - "RenderFlex overflowed by N pixels" — content wider/taller than the
constraint; fix with
Expanded,Flexible,Wrap, or scrolling, not by hardcoding a smaller size.
- "Unbounded height/width" — a
ExpandedvsFlexible:Expandedforces the child to fill the free space;Flexiblelets it be smaller.- Use
MediaQuery/LayoutBuilderfor responsive breakpoints andSafeAreafor notches and system bars; don't hardcode device pixel values. - Long or unbounded lists use
ListView.builder/GridView.builder/CustomScrollViewwith slivers — aListView(children: [...])builds every child up front. - Respect the platform's text scaling and don't fix text container heights in pixels; an accessibility font size setting will overflow them.
Step 6 — State management and data
- Match the existing solution. If there is none and the app is beyond
trivial, recommend one and say why, rather than mixing
setState,InheritedWidget, and a package across screens. - Keep business logic and API access out of widgets — a repository/service
layer keeps
build()free of network code and makes the logic testable without a widget tree. - Model async UI states explicitly (loading / data / empty / error) as a
sealed class or the state library's equivalent; a nullable field plus a
bool leaves impossible combinations representable — same reasoning as
skills/typescript/SKILL.md's discriminated unions. - Dispose of/close whatever the state layer opens (Blocs, Riverpod providers with side effects, streams).
- Local persistence:
shared_preferencesfor small key-values, a real database (Drift/sqflite →skills/sqlite/SKILL.md) for structured data. Never store tokens or secrets inshared_preferences— useflutter_secure_storage, and keep API secrets on a server; a shipped APK or IPA is unpackable.
Step 7 — Platform, assets, and release
- Every asset must be declared in
pubspec.yaml; a missing declaration fails at runtime, not at build. - Permissions are declared per platform (
AndroidManifest.xml,Info.plist) and requested at runtime — adding a plugin is not enough, and a missing iOS usage-description string is an App Store rejection. - Platform channels (
MethodChannel) need an implementation on each targeted platform, plus a fallback when a platform isn't supported. CheckPlatform.isX/kIsWebbefore calling platform-only APIs. flutter analyzeclean anddart formatapplied before done; fix lints rather than adding ignores.- Test on a real profile/release build for performance claims — debug builds
are slow by construction, so "it janks in debug" is not a measurement. Use
DevTools' timeline and the repaint rainbow to find real jank; check for
expensive work in
build, unnecessaryOpacity/ClipRRect/shadow layers, and full-size images decoded at full resolution (cacheWidth/cacheHeight,ListViewitem images). flutter runon both a phone-sized and a tablet/desktop-sized target if the app claims to support both.
Step 8 — Self-check before reporting done
Confirm no build() creates a Future, a controller, or a side effect, and
that const is used wherever the analyzer allows. Confirm every controller,
subscription, and timer created in initState is disposed, and every
await in a State is followed by a mounted check before touching
setState or context. Confirm setState is scoped to the smallest widget
that owns the change, list items have stable keys, and long lists use a
builder. Confirm layout has no overflow or unbounded-constraint error in the
console at any supported size, assets and permissions are declared per
platform, and flutter analyze is clean. Then run the app and drive one
real user task per skills/dev-testing/SKILL.md — treat any console
exception or red error widget as a failure even if the screen looks right.
What not to do
- Don't do side effects, network calls, or
Futurecreation insidebuild(), and don't build controllers there. - Don't skip
const, or replace small widget classes with_buildSomething()helpers that always rebuild. - Don't call
setStateat the top of a screen for a change that affects one small widget. - Don't leave a controller, stream subscription, or timer undisposed.
- Don't use
contextor callsetStateafter anawaitwithout checkingmounted. - Don't fix an overflow by hardcoding sizes, or a
ListViewin aColumnby reaching forshrinkWrapon a long list. - Don't build a long list with
ListView(children: [...]). - Don't introduce a second state-management or routing library alongside the project's existing one without saying so.
- Don't store secrets or tokens in
shared_preferences, and don't embed API secrets in the app at all. - Don't judge performance from a debug build.
- Don't carry web assumptions over — there is no DOM, no CSS, and
skills/react/SKILL.md/skills/html-css/SKILL.md/skills/tailwind/SKILL.mddon't apply here.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

