TranslationLoader class abstract

Implementers

Constructors

TranslationLoader.asset(String asset, {String? package})
Creates a TranslationLoader instance that loads from local asset files. When loading from a package, you must pass the name of the package via the package optional parameter. The asset must be a JSON key / value map.
factory
TranslationLoader.asynchronous(TranslationLoader loader)
Creates a non-blocking TranslationLoader instance that that will load the translations asynchronously and apply them back to the Translator when complete.
factory
TranslationLoader.memory(Map<String, String> values)
Creates a TranslationLoader instance with the given values to utilize.
factory
TranslationLoader.network(String url, {Map<String, String>? headers})
Creates a TranslationLoader instance that loads from a URL. The URL must support returning a JSON key / value map via a GET call.
factory
TranslationLoader.restClient({Authorizer? authorizer, Client? client, Reporter? reporter, required Request request, int retryCount = 0, Duration retryDelay = const Duration(seconds: 1), DelayStrategy? retryDelayStrategy, Duration? timeout})
A more powerful version of the simple network factory. Tihs gives full control over the way the network call is executed. This stillrequires the response from the network call result in a JSON key / value map.
factory

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

load(String language, Translator translator) Future<Map<String, String>>
Interface all TranslationLoader instances must implement. The language to load is passed in but may or may not actually be used by the loader. The built in loaders to not make use of this value to actually perform the loading function. Instead, they only use it to ensure that when translations are loaded asynchronously, the language on the Translator is still the one the loader was attempting to load.
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