LocalizationsPlusDelegate class
A delegate class of localized resources of type Translations implement abstract class LocalizationsDelegate, which can be loaded by a Localizations widget.
Typical applications have one Localizations widget which is created by the
WidgetsApp and configured with the app's localizationsDelegates
parameter (a list of delegates). The delegate's type is used to identify
the object created by an individual delegate's load method.
- Inheritance
-
- Object
- LocalizationsDelegate<
Translations> - LocalizationsPlusDelegate
Constructors
- LocalizationsPlusDelegate({AssetBundle? bundle, String fallbackLocale = "en_US"})
-
const
Properties
- bundle → AssetBundle?
-
optional assetBundle for load locale json file
final
- fallbackLocale → String
-
optional fallback of locale
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → Type
-
The type of the object returned by the load method, T by default.
no setterinherited
Methods
-
isSupported(
Locale locale) → bool -
Whether resources for the given locale can be loaded by this delegate.
override
-
load(
Locale locale) → Future< Translations> -
Start loading the resources for
locale. The returned future completes when the resources have finished loading.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldReload(
covariant LocalizationsPlusDelegate old) → bool -
Returns true if the resources for this delegate should be loaded
again by calling the load method.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited