flutter-run
Skill12 starsChanged 55 days agoMITView on GitHub
Use when running, building, installing or debugging a Flutter app — picking a device or emulator, working with build flavors, passing --dart-define values, loading secrets into a build, or when the app won't start, opens blank, or can't reach the dev API. Covers the task-runner wrapper (Makefile/melos script) that keeps those flags consistent.
- Reads credentials
- Deletes or force-pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- taku-enginner/claude_skillstheir own version, first seen Jan 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- taku-enginner/claude_skills★ 0same 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 repository15 other files it gives its agents.
- flutter-accessibilitySkill
- flutter-cachingSkill
- flutter-clean-archSkill
- flutter-concurrencySkill
- flutter-dart-styleSkill
- flutter-design-systemSkill
- flutter-diSkill
- flutter-formsSkill
- flutter-monorepoSkill
- flutter-new-moduleSkill
- flutter-stateSkill
- flutter-store-cdSkill
- flutter-testingSkill
- flutter-themingSkill
- flutter-webSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 58
Keep .secrets.*.json gitignored and generate it from your secret manager (Doppler, 1Password, Vault, gcloud secrets) in a make secrets …
- Very specific: line 66
If the app declares product flavors, a flutter run without --flavor fails outright — flutter run cannot pick one for you.
- Very specific: line 116
Prefer the repo's task-runner target over a hand-typed flutter run.
- Distinctive: line 117
Never commit the secrets file.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
You are running or building a Flutter app. The core idea of this skill: a bare
flutter run is almost never the right command in a real project. Flavors,
--dart-defines and the Flutter version all have to line up, and remembering
them by hand is where the lost afternoons come from.
Put a task runner in front of flutter
Make the repo's Makefile (or melos script, or just file) the source of truth
for how each app is launched, and run that. It is the only way the flags stay
consistent between your machine, a teammate's, and CI.
A shape that works for a multi-app monorepo:
make setup # pin Flutter (FVM) + bootstrap deps
make secrets ENV=dev PROJECT=<app> # fetch secrets → .secrets.<app>.<env>.json (gitignored)
make dev PROJECT=<app> # web (Chrome), ENV=dev
make dev PROJECT=<app> PLATFORM=android # Android, flavor applied automatically
make build PROJECT=<app> ENV=prod # release buildPin the SDK with FVM (fvm flutter ...) and commit .fvmrc. "Works on my
machine" in Flutter is usually two different SDK minors.
Configuration: --dart-define, and the file form
App config should reach the binary through --dart-define, read back with
String.fromEnvironment:
class AppEnv {
static const baseURL = String.fromEnvironment('BASE_URL');
static const appName = String.fromEnvironment('APP_NAME');
static const apiKey = String.fromEnvironment('X_API_KEY');
}String.fromEnvironment is const and resolved at compile time. Two
consequences that bite:
- A missing define is not an error — it is the empty string. An app that "can't
reach the backend" is very often an empty
BASE_URL, not a network problem. - Changing a define requires a rebuild, not a hot reload.
Pass many values at once with --dart-define-from-file instead of a long chain
of flags:
flutter run --dart-define-from-file=.secrets.myapp.dev.jsonKeep .secrets.*.json gitignored and generate it from your secret manager
(Doppler, 1Password, Vault, gcloud secrets) in a make secrets target. Have
the task runner fall back to a couple of safe public defines when the file is
absent, and print a loud warning — a silent fallback produces an app that
launches and then misbehaves in ways that look like application bugs.
Android flavors
If the app declares product flavors, a flutter run without --flavor fails
outright — flutter run cannot pick one for you. Have the task runner supply
a sensible default and let it be overridden:
make dev PROJECT=<app> PLATFORM=android # default flavor
make dev PROJECT=<app> PLATFORM=android FLAVOR=<other> # pin oneWhere a flavor encodes more than one axis (device model × payment acquirer,
free × paid, region), name it <axisA><AxisB> and derive the matching
--dart-define from the flavor name in the task runner rather than asking the
caller to keep two flags in sync. Apps with no flavors must not be passed
--flavor at all.
Device selection
- Web →
-d chrome(-d webis not a device id; that error is common). - Android/iOS with exactly one device attached → let Flutter auto-select.
- More than one → pin it:
flutter devicesto list, then-d <id>.
Confirm the device is actually visible before debugging anything else — USB debugging off, or an unauthorized adb prompt on the device, looks identical to a broken toolchain.
Quality commands
flutter analyze
dart format . # NOT `flutter format` — removed in Flutter 3.38
flutter test
flutter clean # first thing to try on an inexplicable build failureIn a melos monorepo, run these across packages with melos exec -- <cmd>.
Troubleshooting
| Symptom | Likely cause | Fix |
| App runs but no data, login fails | BASE_URL define empty or pointing at a dead/old backend | Run through the task runner so defines are injected; verify the URL the app compiled with |
| Feature that needs a secret misbehaves, ids come back empty | Only the fallback defines were passed, the rest are "" | Generate the secrets file so --dart-define-from-file injects everything |
| Android build: "flavor must be specified" | Bare flutter run on a multi-flavor app | Pass --flavor, or use the task-runner target that does |
flutter format → "Could not find a command named format" | Removed in Flutter 3.38 | Use dart format . |
Device not found / -d web fails | web is not a device id | Use -d chrome; flutter devices to list real ids |
| Blank white page on web after changing a path dependency | Stale incremental web build | rm -rf build/web and rebuild — see flutter-web |
| Works locally, breaks in CI | SDK version drift | Pin with FVM and commit .fvmrc |
Rules
- Prefer the repo's task-runner target over a hand-typed
flutter run. - Never commit the secrets file; generate it, and gitignore the pattern.
- A fallback for missing config must warn loudly, never fail silently.
- Pin the Flutter SDK version in the repo.
- Changing a
--dart-defineneeds a rebuild — hot reload will not pick it up.
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.

