stackchain 1.1.4 copy "stackchain: ^1.1.4" to clipboard
stackchain: ^1.1.4 copied to clipboard

Scaffold a Flutter app from a YAML config. Add features with one command, keep router and DI in sync, and migrate your stack safely.

Stackchain logo

pub package likes stars license

stackchain #

Scaffold a Flutter app from a YAML config — then keep using it as you build.

Pick your stack once. Generate a runnable app. Add features with one command. Router and DI stay wired. Switch Bloc → Cubit (or a whole preset) later. Your hand-written code stays safe.

Docs · pub.dev · GitHub

Install & run #

Needs an existing Flutter app (flutter create my_app).

cd my_app
dart pub add --dev stackchain
dart run stackchain init
flutter pub get
flutter run

init replaces the counter app with lib/app, lib/core, lib/features, merges dependencies, and runs a quality check. No config file needed — production defaults apply (Bloc + GoRouter + GetIt + Dio).

Choose your stack #

Preset (easiest):

stackchain:
  preset: production_bloc
  features: [splash, auth, home, settings]

Full control:

stackchain:
  # preset: production_bloc   # optional; explicit keys win
  architecture: feature_first   # feature_first | clean | mvvm | mvc
  state_management: bloc        # bloc | cubit | riverpod | provider | getx | rxdart
  routing: go_router            # go_router | auto_route | navigator | getx
  di: get_it                    # get_it | injectable | getx
  network: dio                  # dio | http
  storage:
    - shared_preferences
    - secure_storage
  localization: false
  firebase: false
  flavors: true
  ci: true
  strict_quality: false
  features:
    - splash
    - auth
    - home
    - profile
    - settings

List presets: dart run stackchain presets

What it supports #

Area Options
Architecture feature_first · clean · mvvm · mvc
State management bloc · cubit · riverpod · provider · getx · rxdart
Routing go_router · auto_route · navigator · getx
DI get_it · injectable · getx
Network dio · http
Storage shared_preferences · secure_storage · hive
Extras flavors · CI workflow · localization · firebase · dark mode · analytics · crashlytics · biometrics
Presets production_bloc · production_riverpod · production_rxdart · clean_cubit · getx_mvc · firebase_bloc · minimal

Also out of the box: session + secure storage, auth route guards (when auth exists), Dio interceptors (auth / retry / errors), and a quality gate on every generate.

Everyday commands #

# Features
dart run stackchain feature auth     # files + routes + DI + tests
dart run stackchain add notifications
dart run stackchain rename profile account
dart run stackchain remove auth

# Stay in sync
dart run stackchain sync             # re-wire router & DI
dart run stackchain upgrade          # refresh deps
dart run stackchain migrate --state cubit --dry-run
dart run stackchain migrate --state cubit
dart run stackchain migrate --preset production_riverpod

# Trust & generate
dart run stackchain doctor
dart run stackchain presets
dart run stackchain make page onboarding
dart run stackchain make widget app_chip
dart run stackchain make service analytics

Your code is safe #

Generated router/DI files use markers:

// <stackchain:routes>
GoRoute(path: AppRoutes.home, ...),
// </stackchain:routes>

sync / feature / upgrade / migrate only rewrite code inside those markers. Everything outside is yours.

What init generates #

lib/
├── app/           # App widget, theme, config, router
├── core/          # network, storage, DI, errors, utils, session, widgets
├── features/      # one module per feature (layout matches architecture)
└── main.dart      # replaces Flutter counter template
.stackchain/
└── lock.yaml      # stack fingerprint for upgrade / migrate

Example stacks #

Riverpod

stackchain:
  preset: production_riverpod
  features: [home, profile]

GetX + MVC

stackchain:
  preset: getx_mvc
  features: [splash, auth, home]

Bloc + GoRouter + GetIt (manual)

stackchain:
  architecture: feature_first
  state_management: bloc
  routing: go_router
  di: get_it
  network: dio
  features: [auth, home]

License #

MIT

Support & contribute #

If stackchain saves you time:

Contributions of any size help. Thank you for the love and support ❤️

4
likes
0
points
599
downloads

Documentation

Documentation

Publisher

verified publisherevenlogix.com

Weekly Downloads

Scaffold a Flutter app from a YAML config. Add features with one command, keep router and DI in sync, and migrate your stack safely.

Homepage
Repository (GitHub)
View/report issues

Topics

#flutter #generator #scaffold #architecture #bloc

License

unknown (license)

Dependencies

ansicolor, args, collection, path, recase, yaml

More

Packages that depend on stackchain