Skip to content

Quick start

  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) Set your stack

    Create stackchain.yaml at the project root:

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

    Skip this to use defaults (Bloc + GoRouter + GetIt).

  4. Scaffold

    Terminal window
    dart run stackchain init
  5. Run

    Terminal window
    flutter pub get
    flutter run

    With flavors (default):

    Terminal window
    flutter run -t lib/main_dev.dart --dart-define=FLAVOR=dev
Terminal window
dart run stackchain feature auth

Creates the feature folder, wires routes + DI, adds a default unit test.

Terminal window
dart run stackchain test auth
# or every feature:
dart run stackchain test --all

Custom assertions go in test/features/auth_custom_test.dart (never overwritten).

lib/
├── app/ # App, theme, router
├── core/ # network, storage, DI, session
├── features/ # one folder per feature
└── main.dart