FlutterI18n class

Facade used to hide the loading and translations logic

Constructors

FlutterI18n(TranslationLoader? translationLoader, String keySeparator, {MissingTranslationHandler? missingTranslationHandler})

Properties

decodedMap ↔ Map?
read / write
hashCode → int
The hash code for this object.
read-onlyinherited
isLoadedStream → Stream<bool>
read-only
keySeparator ↔ String?
read / write
loadingStream → Stream<LoadingStatus>
read-only
locale → dynamic
The locale used for the translation logic
read-only
missingTranslationHandler ↔ MissingTranslationHandler
read / write
runtimeType → Type
A representation of the runtime type of the object.
read-onlyinherited
translationLoader ↔ TranslationLoader?
read / write

Methods

load() → Future<bool>
Used to load the locale translation file
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

currentLocale(BuildContext context) → Locale?
Same as get locale, but this can be invoked from widgets
plural(BuildContext context, String translationKey, int pluralValue) → String
Facade method to the plural translation logic
refresh(BuildContext context, Locale? forcedLocale) → Future
Facade method to force the load of a new locale
retrieveLoadedStream(BuildContext context) → Stream<bool>
Used to check if the translation file is still loading
retrieveLoadingStream(BuildContext context) → Stream<LoadingStatus>
Used to retrieve the loading status stream
rootAppBuilder() → Widget Function(BuildContext, Widget?)
Build for root widget, to support RTL languages
translate(BuildContext context, String key, {String? fallbackKey, Map<String, String>? translationParams}) → String
Facade method to the simple translation logic