LocalizedStringExt extension
Extension on String to provide easy access to translation methods.
This extension adds two methods, tr and trParams, to the String class,
allowing you to easily translate strings within the Flutter application using
the LocalizationManager provided by the LocalizationProvider. These methods facilitate
obtaining localized text, which is essential for supporting multiple languages in the app.
- on
Methods
-
tr(
[BuildContext? context]) → String -
Available on String, provided by the LocalizedStringExt extension
Translates the string key using theLocalizationManagerfrom the provided context. -
trParams(
Map< String, dynamic> namedArgs, [BuildContext? context]) → String -
Available on String, provided by the LocalizedStringExt extension
Translates the string key with parameters using theLocalizationManagerfrom the provided context. -
trPlural(
int count, [BuildContext? context]) → String -
Available on String, provided by the LocalizedStringExt extension