Skip to content

Quick start

Get from an empty Flutter app to a runnable scaffold with flavors, DI, routing, and a home feature.

  1. Create a Flutter app

    Terminal window
    flutter create my_app
    cd my_app
  2. Add stackchain

    Terminal window
    dart pub add --dev stackchain
  3. (Optional) Commit a config

    Create stackchain.yaml at the project root:

    stackchain:
    preset: production_bloc
    features:
    - splash
    - auth
    - home
    - settings

    Skip this step to use defaults; init will write a starter YAML.

  4. Initialize

    Terminal window
    dart run stackchain init

    What 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
  5. Add / rename / remove slices

    Terminal window
    dart run stackchain feature auth
    dart run stackchain rename profile account
    dart run stackchain remove notifications

    Named recipes like auth, settings, and profile generate richer extras (forms, tests). Generic names get a solid baseline + smoke tests.

  6. Resolve packages and run

    Terminal window
    flutter pub get
    flutter run

    With flavors enabled (default):

    Terminal window
    flutter run -t lib/main_dev.dart --dart-define=FLAVOR=dev
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
Terminal window
dart run stackchain sync
dart run stackchain doctor
dart run stackchain make page onboarding
dart run stackchain make widget app_chip
dart run stackchain make service analytics
dart run stackchain upgrade
dart run stackchain migrate --state bloc --dry-run

Configure every field in Configuration.