CookieLocaleResolver class

{@link LocaleResolver} implementation that uses a cookie sent back to the user in case of a custom setting, with a fallback to the specified default locale or the request's accept-header locale.

This is particularly useful for stateless applications without user sessions.

Inheritance

Constructors

CookieLocaleResolver()

Properties

cookieManager CookieHolderManager
read / write
The default cookie name used if none is explicitly set.
final
defaultLocale Intl
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

determineDefaultLocale(ForceRequest request) Intl
Determine the default locale for the given request, Called if no locale cookie has been found. [...]
getDefaultLocale() Intl
Return the fixed Locale that this resolver will return if no cookie found, if any.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
resolveLocale(ForceRequest request) Intl
Resolve the current locale via the given request. Should return a default locale as fallback in any case. @param request the request to resolve the locale for @return the current locale (never null)
override
setDefaultLocale(Intl defaultLocale) → void
Set a fixed Locale that this resolver will return if no cookie found.
override
setLocale(ForceRequest request, Intl locale) → void
Set the current locale to the given one. @param request the request to be used for locale modification @param locale the new locale, or null to clear the locale @throws UnsupportedOperationException if the LocaleResolver implementation does not support dynamic changing of the theme
override
toString() String
Returns a string representation of this object.
inherited

Operators

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