LocalizedStringExt extension

Extends the String class to provide an easy and convenient way to translate text directly from string literals or variables.

By calling the tr() method on any string, the text is automatically localized using the translations available in the nearest LocalizationProvider up the widget tree.

on

Methods

tr(BuildContext context) String
Translates the string based on the current locale's translations.