TranslationLoader.restClient constructor
TranslationLoader.restClient({})
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.
This is a blocking loader and will not resolve the Future until the
translations are loaded. Wrap this in an AsyncTranslationLoader to
avoid blocking the Translator on initialize
, load, or reload
.
This is a convenience factory constructor and is ultimately a synonym for constructing an RestClientTranslationLoader directly.
Implementation
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,
}) =>
RestClientTranslationLoader(
authorizer: authorizer,
client: client,
reporter: reporter,
request: request,
retryCount: retryCount,
retryDelay: retryDelay,
retryDelayStrategy: retryDelayStrategy,
timeout: timeout,
);