TranslatorGenerator class

Properties

currentLocale Locale?
Get the current locale of the app.
no setter
hashCode int
The hash code for this object.
no setterinherited
localizationsDelegates Iterable<LocalizationsDelegate>
Apply all the needed delegate and the package delegate for the app. This will use at the MaterialApp
no setter
onTranslatedLanguage ↔ TranslatorCallback?
Callback for the translation. This will call after the translate function is called.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedLanguageCodes List<String>
Get the list of supported language code provide by the init function
no setter
supportedLocales Iterable<Locale>
Generate the supported locales for the app. This will use at the MaterialAap
no setter

Methods

getLanguageName({String? languageCode}) String
This just call the getName() function from Translator class for getting the full language name by the language code.
getString(String key) String
This just call the getString() function from Translator class for getting the translated value from map data.
init({required List<MapLocale> mapLocales, required String initLanguageCode, String? initCountryCode}) Future<void>
Initialize the list of mapLocale (see MapLocale model for info) and initLanguageCode code when the app is start up. Both field will required.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
translate(String languageCode, {String countryCode = '', bool save = true}) → void
Call this function at where you want to translate the app like by pressing the button or any actions.

Operators

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

Static Properties

instance TranslatorGenerator
The instance object of TranslatorGenerator class.
final