FreeLocalizationsDelegate class

Inheritance

Constructors

FreeLocalizationsDelegate()
const

Properties

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
是否支持某个Local
override
load(Locale locale) Future<FreeLocalizations>
Flutter会调用此类加载相应的Locale资源类
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldReload(covariant LocalizationsDelegate<FreeLocalizations> old) bool
shouldReload的返回值决定当Localizations组件重新build时, 是否调用load方法重新加载Locale资源。一般情况下, Locale资源只应该在Locale切换时加载一次, 不需要每次在Localizations重新build时都加载, 所以返回false即可。可能有些人会担心返回false的话在APP 启动后用户再改变系统语言时load方法将不会被调用,所以Locale资源将不会被加载。 事实上,每当Locale改变时Flutter都会再调用load方法加载新的Locale, 无论shouldReload返回true还是false。
override
toString() String
A string representation of this object.
inherited

Operators

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