TranslatorDelegate class abstract
An abstract delegate class to provide translation capabilities. Implement this class to define how translations are fetched, cached, and stored.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cache(
) → Future< String?> - Optionally provide a cached JSON source of previously translated strings. Default implementation returns null.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
String source) → void -
Save the serialized translation cache.
valueis the JSON-encoded string of all translations. -
toString(
) → String -
A string representation of this object.
inherited
-
translate(
String source, Locale locale) → Future< String> -
Translate a given
sourcestring to the targetlocale. Returns the translated string asynchronously. -
translated(
String key, String value) → void -
Callback triggered when a translation is completed.
keyis the original string,valueis the translated string.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited