A new Flutter project.
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
This app uses Flutter's built-in gen-l10n with ARB files.
- ARB source:
lib/l10n/app_en.arb,lib/l10n/app_es.arb - Config:
l10n.yaml - Generated:
lib/l10n/generated/
- Edit
lib/l10n/app_en.arbto add a key and description. - Add the Spanish translation in
lib/l10n/app_es.arb. - Run codegen:
flutter gen-l10n(runs automatically on build; restarting the app may be required).
Example:
{
"greeting": "Hello",
"@greeting": {"description": "Simple greeting"}
}Access in code:
final loc = AppLocalizations.of(context);
Text(loc.greeting);English (en) and Spanish (es) are enabled via AppLocalizations.supportedLocales.
- Placeholders require an
examplestring in metadata. - Changing ARB files requires a full restart for hot reload to pick up generated code.
- If
lib/l10n/untranslated_messages.txtis non-empty, add translations before release.