state_management
Free · v0.1.0Generate a state management layer for an existing feature module. Supports BLoC, Cubit, Riverpod, and Provider.
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
stateManagement | enum | cubit | State management solution (bloc, cubit, riverpod, provider) |
featureName | string | feature | Feature name (e.g., auth, checkout, profile) |
usecaseName | string | "" | Usecase to wire up (e.g., login). Leave empty for blank skeleton |
outputPath | string | "" | Sub-path within presentation/ directory |
Usage
Interactive
bash
archipelago generate state_managementCI / Config File
bash
archipelago generate state_management --config config.jsonjson
{
"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.dartFor BLoC:
features/auth/lib/src/presentation/
└── login/
├── login_bloc.dart
├── login_event.dart
└── login_state.dartWhen 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
- Tutorial: State Management Brick
- feature_monorepo_skeleton — Creates the feature module structure