skills/flutter/flutter-localization/SKILL.md
Implement internationalization using Flutter's built-in l10n with ARB files and ICU message syntax. Use when adding multi-language support, managing translations, handling plurals/gender forms, or supporting RTL layouts.
npx skillsauth add dhruvanbhalara/skills flutter-localizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
flutter_localizations and intl packagesgenerate: true in pubspec.yaml for automatic code generationl10n.yaml at project root:
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
output-class: AppLocalizations
nullable-getter: false
.arb files in lib/l10n/app_{locale}.arb naming convention (e.g., app_en.arb, app_es.arb, app_hi.arb)app_en.arb) MUST contain @ metadata for every key:
{
"loginTitle": "Sign In",
"@loginTitle": { "description": "Title on the login screen" },
"itemCount": "{count, plural, =0{No items} =1{1 item} other{{count} items}}",
"@itemCount": { "description": "Item count with pluralization", "placeholders": { "count": { "type": "int" } } }
}
featureName_context format (e.g., settings_title, login_emailHint)context.l10n.keyName using a BuildContext extension.l10n in initState() or outside the widget tree — context must be availableintl package formatters with the current locale{count, plural, =0{...} =1{...} other{...}}{gender, select, male{...} female{...} other{...}}other case as a fallbackDirectionality and TextDirection-aware widgetsEdgeInsetsDirectional over EdgeInsets for padding/marginsstart/end instead of left/right in MainAxisAlignment and CrossAxisAlignmentapp_{locale}.arb with all keys translatedflutter gen-l10n (or rely on auto-generation)Locale to supportedLocales in MaterialAppdevelopment
Perform REST API networking operations (GET, POST, PUT, DELETE) using the lightweight and robust standard `http` package, including platform configurations and background parsing models.
development
Configure internationalization and localization support using Flutter's built-in l10n system, App Resource Bundle (ARB) files, and ICU formatting syntax.
development
Create model classes with fromJson/toJson using dart:convert and Dart 3 pattern matching. Use when manually mapping JSON to classes, parsing HTTP responses, or choosing between manual and code-generated serialization.
data-ai
Diagnose and fix Flutter layout constraint violations (RenderFlex overflow, unbounded height/width, ParentData misuse). Use when encountering layout exceptions, yellow-black overflow stripes, or red error screens.