Skip to content

state_management

Free · v0.1.0

Generate a state management layer for an existing feature module. Supports BLoC, Cubit, Riverpod, and Provider.

Variables

VariableTypeDefaultDescription
stateManagementenumcubitState management solution (bloc, cubit, riverpod, provider)
featureNamestringfeatureFeature name (e.g., auth, checkout, profile)
usecaseNamestring""Usecase to wire up (e.g., login). Leave empty for blank skeleton
outputPathstring""Sub-path within presentation/ directory

Usage

Interactive

bash
archipelago generate state_management

CI / Config File

bash
archipelago generate state_management --config config.json
json
{
  "stateManagement": "cubit",
  "featureName": "auth",
  "usecaseName": "login",
  "outputPath": "login"
}

What It Generates

For a Cubit with featureName: auth and usecaseName: login:

features/auth/lib/src/presentation/
  └── login/
      ├── login_cubit.dart
      └── login_state.dart

For BLoC:

features/auth/lib/src/presentation/
  └── login/
      ├── login_bloc.dart
      ├── login_event.dart
      └── login_state.dart

When to Use

Use this brick to add state management to a feature that was created without it (e.g., with feature_monorepo_skeleton using stateManagement: none), or to add additional state management modules to existing features.

See Also

Built by Banua Coder