Skip to content

stackchain

Flutter scaffolding from a simple config. Use presets, add full features, keep router and DI in sync, migrate safely, and run quality checks on every generate.

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
- home

Or start from a production preset:

stackchain:
preset: production_bloc
features: [splash, auth, home, settings]
Terminal window
dart pub add --dev stackchain
dart run stackchain init
dart run stackchain feature auth
flutter pub get
flutter run
Terminal window
dart run stackchain init
dart run stackchain init --overwrite
dart run stackchain init --dry-run

Presets

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 riverpodbloc, 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 → CLI engine → generated Flutter app with templates, smart merge, and quality gate

  1. You define architecture, state, routing, DI, network, and storage in stackchain.yaml (or pick a preset).
  2. init scaffolds lib/app, lib/core, lib/features, merges pubspec deps, writes .stackchain/lock.yaml, and runs the gate.
  3. 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
  • Teams shipping production Flutter apps that want a repeatable structure
  • Solo developers who want feature-first (or clean / MVVM / MVC) scaffolding without boilerplate
  • Maintainers who expect the stack to evolve, not freeze on day one
  • Tiny prototypes where a single main.dart is enough
  • Apps with a custom architecture that cannot map to feature_first / clean / mvvm / mvc
  • Projects that must never run generation tooling against the tree