home_sdk Free
Home feature SDK with dashboard, profile, and settings pages using dual-GetIt DI pattern and per-feature slang translations.
Version: 1.0.0
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| appName | string | MyApp | The name of your application |
| prefix | string | App | Prefix for generated classes (e.g. App, My) |
| uiKitPackageName | string | app_ui_kit | Name of the UI kit package |
| isForMonorepo | boolean | true | Whether this will be part of a monorepo structure |
| stateManagement | enum | cubit | State management solution: bloc, cubit, riverpod, provider |
Generated Structure
features/
└── home/
├── home_api/
│ ├── lib/
│ │ ├── home_api.dart
│ │ └── src/
│ │ └── home_sdk.dart # Home FeatureSDK contract
│ └── pubspec.yaml
└── home_impl/
├── l10n/ # Per-feature translations
│ ├── home_en.i18n.json
│ └── home_id.i18n.json
├── lib/
│ ├── home_impl.dart
│ └── src/
│ ├── home_sdk_impl.dart
│ ├── di/
│ │ ├── home_global_module.dart
│ │ ├── home_local_module.dart
│ │ └── injector.dart
│ ├── l10n/
│ │ └── home_translations.g.dart # Generated by slang
│ ├── presentation/
│ │ ├── home_shell_page.dart # Locale sync + DI scope
│ │ ├── home/home_page.dart # Uses context.homeL10n
│ │ ├── profile/profile_page.dart
│ │ └── settings/settings_page.dart # Uses context.homeL10n
│ └── router/
├── slang.yaml # Home-specific slang config
├── build.yaml # Includes slang_build_runner
└── pubspec.yamlPer-Feature Translations
Home has its own slang configuration with feature-scoped translations:
yaml
# slang.yaml
translate_var: homeL10n # Access via context.homeL10n
enum_name: HomeLocale
class_name: HomeTranslationsTranslation strings cover dashboard, settings, and profile sections in English and Indonesian.
Key Features
- Dual-GetIt DI — Global (HomeSDK) + local (repos, usecases) scoped to shell page lifecycle
- Locale sync — Shell page maps global
AppLocale→HomeLocalefor feature-scoped translations - Localized settings — Language switcher uses slang translations for display names
- Cross-feature navigation — Dashboard links to profile and settings via AutoRoute
State Management
The brick generates state management files based on the stateManagement variable passed from the parent flutter_modular_monorepo brick. Supported values: bloc, cubit, riverpod, provider.
Derived boolean variables computed in pre_gen.dart:
isBloc— true whenstateManagement == blocisCubit— true whenstateManagement == cubitusesBloc— true whenisBloc || isCubit(both useflutter_bloc)isRiverpod— true whenstateManagement == riverpodisProvider— true whenstateManagement == provider
Pages use typed design system extensions (context.colors, context.typography, etc.) instead of Theme.of(context).