Presets
One-line blueprints like production_bloc, production_riverpod, getx_mvc, and firebase_bloc.

stackchain is a Flutter CLI you keep as a dev dependency — not a one-shot generator. Declare your stack once in stackchain.yaml, generate a runnable app, add vertical slices as you build, then sync / upgrade / migrate as the project evolves. Every generate runs a quality gate.
package v1.1.3 · MIT
stackchain: architecture: feature_first state_management: bloc routing: go_router di: get_it network: dio storage: - shared_preferences - secure_storage features: - splash - auth - homeOr start from a production preset:
stackchain: preset: production_bloc features: [splash, auth, home, settings]dart pub add --dev stackchaindart run stackchain initdart run stackchain feature authflutter pub getflutter rundart run stackchain initdart run stackchain init --overwritedart run stackchain init --dry-rundart run stackchain feature authdart run stackchain rename profile accountdart run stackchain remove authdart run stackchain syncdart run stackchain upgradedart run stackchain migrate --state blocdart run stackchain doctordart run stackchain presetsPresets
One-line blueprints like production_bloc, production_riverpod, getx_mvc, and firebase_bloc.
Vertical slices
feature / rename / remove wire or tear down files + router + DI + tests.
Smart merge
Only managed <stackchain:…> regions are updated. Hand-written code outside markers survives.
Migrate & upgrade
Evolve riverpod → bloc, switch presets, refresh deps — bootstrap, DI, and tests included.
Quality gate
Structure checks, security baseline, and optional strict dart analyze on every generate.
Bricks
make page|widget|service plus custom project bricks under .stackchain/bricks/.
stackchain.yaml (or pick a preset).init scaffolds lib/app, lib/core, lib/features, merges pubspec deps, writes .stackchain/lock.yaml, and runs the gate.feature / rename / remove / sync / upgrade / migrate update managed regions — your custom logic outside markers stays.See How it works for the full pipeline.
| Problem | Manual Flutter setup | With stackchain |
|---|---|---|
| Architecture consistency | Copy-paste folders forever | One YAML source of truth |
| Adding a feature | Create 10+ files by hand | dart run stackchain feature auth |
| Renaming a feature | Manual path + import surgery | dart run stackchain rename profile account |
| Removing a feature | Leftover routes/DI | dart run stackchain remove auth |
| Wiring router + DI | Easy to forget | Smart merge into managed regions |
| Changing state library mid-project | Painful rewrite | migrate --state bloc |
| Dependency drift | Manual pubspec edits | upgrade refreshes inferred deps |
| Quality baseline | Optional / forgotten | Gate on every generate |
main.dart is enough