LocalinoConfig class

Map of supported locales, default locale and loading rules.

Config is passed to Control.initControl to init Localino.

Constructors

LocalinoConfig({String? defaultLocale, String? stableLocale, required Map<String, String?> locales, bool initLocale = true, bool loadDefaultLocale = true, bool handleSystemLocale = false})
defaultLocale - Default (not preferred) locale. This locale can contains non-translatable values (links, etc.). locales - Map of localization assets {'locale', 'path'}. Use LocalinoAsset.map for easier setup. initLocale - Automatically loads system or preferred locale. loadDefaultLocale - Loads defaultLocale before preferred locale. handleSystemLocale - Listen for default locale of the device. Whenever this locale is changed, localization will change locale (but only when there is no preferred locale).
const

Properties

defaultLocale String?
Default locale key. If not provided, first locale from locales is used.
final
fallbackLocale String
Returns default of first locale key.
no setter
handleSystemLocale bool
Check to handle system locale.
final
hashCode int
The hash code for this object.
no setterinherited
initLocale bool
Check to init locale - Localino.init.
final
loadDefaultLocale bool
Check to load default locale.
final
locales Map<String, String?>
Map of locales - key: path.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stableLocale String?
Locale key of non-translatable data.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toAssets() List<LocalinoAsset>
Converts Map of locales to List of LocalinoAssets.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

empty LocalinoConfig
no setter
systemLocale String
no setter