PlayxLocaleConfig class
Locale config : used to configure out app locales by providing the app with the supported locales and localization settings. Create a class that extends the PlayxLocaleConfig class to implement your own locales.
Constructors
-
PlayxLocaleConfig({required List<
XLocale> supportedLocales, XLocale? startLocale, XLocale? fallbackLocale, bool useOnlyLangCode = false, bool useFallbackTranslations = true, String path = 'assets/translations', AssetLoader assetLoader = const RootBundleAssetLoader(), bool saveLocale = true})
Properties
- assetLoader → AssetLoader
-
Class loader for localization files.
You can use custom loaders from Easy Localization Loader or create your own class.
@Default value
const RootBundleAssetLoader()
final - fallbackLocale → XLocale?
-
Fallback Locale when the locale is not in the list.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- path → String
-
Path to your folder with localization files.
Example:
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- saveLocale → bool
-
Save locale in device storage.
@Default value true
final
- startLocale → XLocale?
-
First Locale that the app starts with if there is not any saved locale.
If equals null then it uses device locale.
final
-
supportedLocales
→ List<
XLocale> -
final
- useFallbackTranslations → bool
-
If a localization key is not found in the locale file, try to use the fallbackLocale file.
@Default value true
Example:
final
- useOnlyLangCode → bool
-
Trigger for using only language code for reading localization files.
@Default value false
Example:
final
Methods
-
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