L10nTranslations class abstract

Supply the 'translation Map objects'

e.g. //ignore: non_constant_identifier_names final AppTrs = AppTranslations();

Constructors

L10nTranslations()

Properties

delegate LocalizationsDelegate<L10nLocale>
Supply the Localization Delegate
no setter
hashCode int
The hash code for this object.
no setterinherited
l10nMap Map<Locale, Map<String, String>>
The app's translations
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedLocales List<Locale>
Use this getter below for your MaterialApp supportedLocales parameter It will also load the translations defined above.
no setter
textLocale Locale
The text's original Locale
no setter

Methods

getLocale(int index) Locale?
Get a Locale from the List of 'supported' Locales.
localeOf(BuildContext? context, {bool? allowLocaleChange}) Locale?
Record the device's Locale at that point in time. Traditionally placed in a build() function.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
of(Text? text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, Locale? locale, bool? softWrap, TextOverflow? overflow, double? textScaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis}) Text
Convert a Text object to one with a translation.
s(String? word) String
Translate the String
setLocale(Locale? locale) bool
Explicitly set a supported Locale using this class Allow your App to not reference L10n or L10nLocale at all. Set the Locale to translate Returns true if set to that Locale
t(String? data, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, Locale? locale, bool? softWrap, TextOverflow? overflow, double? textScaleFactor, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior}) Text
Supply a Text object for the translation.
toLocale(String? _locale) Locale?
Return a Locale object from the provided String
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited