Flutter UI and Localization Rules
When working on Flutter UI components, you must follow these rules strictly:
- •No Hardcoded Strings: NEVER use hardcoded static strings for user-facing text (e.g.,
Text('Search')is strictly forbidden). - •Use AppLocalizations: ALWAYS use the app's localization class:
AppLocalizations.of(context)!.string_key. - •Naming Convention: Format all localization keys in
snake_case. - •Supported Languages and Files: This application supports the following languages. You must use these exact files for translations:
- •English:
lib/core/localization/app_en.arb - •German:
lib/core/localization/app_de.arb - •Italian:
lib/core/localization/app_it.arb - •French:
lib/core/localization/app_fr.arb - •Romansh:
lib/core/localization/app_ro.arb
- •English:
- •Direct File Editing Requirement: If a completely new string is needed, DO NOT just print the JSON in our chat. You MUST directly modify all the
.arbfiles listed above to insert the new translated key-value pairs into the JSON structures. Ensure the JSON remains perfectly valid.