flutter_l10n Free
A Mason brick for generating a Flutter localization package using Slang, with shared locale state management for scoped localization across features.
Version: 1.0.0
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| appName | string | MyApp | Application name for package naming |
| prefix | string | App | Prefix for component naming |
| isForMonorepo | boolean | true | Whether this package will be part of a monorepo structure |
| includeGenerated | boolean | false | Whether to include generated files in version control |
Usage
Interactive
bash
archipelago generate flutter_l10nNon-interactive (CI)
bash
archipelago generate flutter_l10n --config my_config.jsonConfig Template
json
{
"@appName": "Application name for package naming",
"appName": "MyApp",
"@prefix": "Prefix for component naming",
"prefix": "App",
"@isForMonorepo": "Whether this package will be part of a monorepo structure",
"isForMonorepo": true,
"@includeGenerated": "Whether to include generated files in version control",
"includeGenerated": false
}Generated Structure
shared/
└── locale_core/
├── lib/
│ ├── locale_core.dart # Barrel file
│ └── src/
│ ├── {prefix}_locale.dart # Locale definitions
│ └── locale_state.dart # Shared locale state management
├── analysis_options.yaml
├── pubspec.yaml
└── README.md