Skip to content

Installation

stackchain is published on pub.dev and runs via dart run. Add it only to dev_dependencies.

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
Terminal window
cd my_app
dart pub add --dev stackchain
Terminal window
cd my_app
flutter pub add --dev stackchain
dev_dependencies:
stackchain: ^1.1.3

Then:

Terminal window
dart pub get
# or
flutter pub get
Terminal window
dart run stackchain help

You should see the command list (init, feature, add, remove, rename, sync, upgrade, migrate, doctor, presets, make, list, new).

Invocation Behavior
dart run stackchain … Main CLI (bin/stackchain.dart)
dart run stackchain:init Shortcut that runs init (bin/init.dart)

If stackchain.yaml is missing, init applies production defaults and writes a starter stackchain.yaml (with features: [home] and commented options).

Terminal window
dart run stackchain init

Defaults 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.

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)

Follow the Quick start to scaffold and run the app.