FlutterI18n class

Facade used to hide the loading and translations logic

Constructors

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

Properties

decodedMap Map?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isLoadedStream Stream<bool>
no setter
keySeparator String?
getter/setter pair
loadingStream Stream<LoadingStatus>
no setter
locale → dynamic
The locale used for the translation logic
no setter
missingTranslationHandler MissingTranslationHandler
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
translationLoader TranslationLoader?
getter/setter pair

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