FluteLocalizationProvider<T extends FluteLanguageBase> class
abstract
Example
abstract class LanguageBase implements FluteLanguageBase {
String get name;
}
class English implements LanguageBase {
@override
Locale get locale => const Locale('en');
@override
String get name => 'name';
}
class LocalizationProvider extends FluteLocalizationProvider<LanguageBase> {
LocalizationProvider(LanguageBase language) : super(language);
@override
Map<String, LanguageBase> get locales => {
'en': English(),
};
}
- Inheritance
-
- Object
- FluteProviderBase
- FluteProvider<
T> - FluteLocalizationProvider
Constructors
- FluteLocalizationProvider(T language)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- kLocaleKey → String
-
final
- locale → Locale
-
no setter
-
locales
→ Map<
String, T> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → T
-
The state which immutable.
no setterinherited
-
supportedLocales
→ Iterable<
Locale> -
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object notifies its listeners.
inherited
-
dispose(
) → void -
Disposes the Provider, after that, it cannot be used.
inherited
-
listen(
_ListenerCallback< T> listener) → Function -
Listens the state changes, similar to addListener and removeListener
but it has access to the state.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Notifies all listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
set(
T newState) → void -
To set the state, you can use set method.
inherited
-
setLocale(
String? newLocale) → void -
toString(
) → String -
A string representation of this object.
inherited
-
update(
_UpdateCallback< T> callback) → void -
To update the state, you can use update method.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited