Quick start
Get from an empty Flutter app to a runnable scaffold with flavors, DI, routing, and a home feature.
-
Create a Flutter app
Terminal window flutter create my_appcd my_app -
Add stackchain
Terminal window dart pub add --dev stackchain -
(Optional) Commit a config
Create
stackchain.yamlat the project root:stackchain:preset: production_blocfeatures:- splash- auth- home- settingsSkip this step to use defaults;
initwill write a starter YAML. -
Initialize
Terminal window dart run stackchain initWhat happens:
- Detects a Flutter app via
pubspec.yaml - Parses config (or defaults)
- Writes
lib/app,lib/core,lib/features, entrypoints - Merges inferred dependencies into
pubspec.yaml - Replaces the stock counter
main.dart - Writes
.stackchain/lock.yaml - Runs the quality gate
- Detects a Flutter app via
-
Add / rename / remove slices
Terminal window dart run stackchain feature authdart run stackchain rename profile accountdart run stackchain remove notificationsNamed recipes like
auth,settings, andprofilegenerate richer extras (forms, tests). Generic names get a solid baseline + smoke tests. -
Resolve packages and run
Terminal window flutter pub getflutter runWith flavors enabled (default):
Terminal window flutter run -t lib/main_dev.dart --dart-define=FLAVOR=dev
What you get
Section titled “What you get”| Area | Generated |
|---|---|
| App shell | lib/app/ — theme, config, router |
| Core | network, storage, DI, errors, utils, session, widgets |
| Features | vertical folders matching your architecture |
| Flavors | main_dev.dart / main_staging.dart / main_prod.dart when enabled |
| CI | .github/workflows/stackchain_ci.yml when ci: true |
| Lock | .stackchain/lock.yaml |
Common next commands
Section titled “Common next commands”dart run stackchain syncdart run stackchain doctordart run stackchain make page onboardingdart run stackchain make widget app_chipdart run stackchain make service analyticsdart run stackchain upgradedart run stackchain migrate --state bloc --dry-runConfigure every field in Configuration.