Installation
stackchain is published on pub.dev and runs via dart run. Add it only to dev_dependencies.
Requirements
Section titled “Requirements”| Requirement | Notes |
|---|---|
| Dart SDK | ^3.5.0 (as declared by the package) |
| Flutter app | An existing project with a Flutter pubspec.yaml |
| Network | First run resolves packages from pub.dev |
Add the package
Section titled “Add the package”Option A — dart pub
Section titled “Option A — dart pub”cd my_appdart pub add --dev stackchainOption B — flutter pub
Section titled “Option B — flutter pub”cd my_appflutter pub add --dev stackchainOption C — pubspec.yaml
Section titled “Option C — pubspec.yaml”dev_dependencies: stackchain: ^1.1.3Then:
dart pub get# orflutter pub getVerify the CLI
Section titled “Verify the CLI”dart run stackchain helpYou should see the command list (init, feature, add, remove, rename, sync, upgrade, migrate, doctor, presets, make, list, new).
Executable aliases
Section titled “Executable aliases”| Invocation | Behavior |
|---|---|
dart run stackchain … |
Main CLI (bin/stackchain.dart) |
dart run stackchain:init |
Shortcut that runs init (bin/init.dart) |
First init without a config file
Section titled “First init without a config file”If stackchain.yaml is missing, init applies production defaults and writes a starter stackchain.yaml (with features: [home] and commented options).
dart run stackchain initDefaults include:
| Key | Default |
|---|---|
architecture |
feature_first |
state_management |
bloc |
routing |
go_router |
di |
get_it |
network |
dio |
storage |
[shared_preferences, secure_storage] |
features |
[home] |
dark_mode |
true |
core_services / core_widgets |
true |
flavors / ci |
true |
Smart defaults: if you set state_management: getx and omit routing / di, both become getx.
Global flags
Section titled “Global flags”These work on most generate commands:
| Flag | Short | Description |
|---|---|---|
--help |
-h |
Show usage |
--overwrite |
-f |
Overwrite existing generated files |
--dry-run |
Print actions without writing | |
--verbose |
-v |
Verbose logging |
--skip-analyze |
Skip dart analyze in the quality gate |
|
--path |
-p |
Flutter project root (default: cwd) |
Next step
Section titled “Next step”Follow the Quick start to scaffold and run the app.