load method

  1. @override
Future<Map<String, String>> load(
  1. String language,
  2. Translator translator
)
override

The returned Future will wait until the JSON data is loaded and processed from the network and call and then resolve with resulting values.

Implementation

@override
Future<Map<String, String>> load(
  String language,
  Translator translator,
) async {
  final response = await client.execute(
    authorizer: authorizer,
    reporter: reporter,
    request: request,
    retryCount: retryCount,
    retryDelay: retryDelay,
    retryDelayStrategy: retryDelayStrategy,
    timeout: timeout,
  );

  final result = <String, String>{};
  final converted = response.body;

  converted?.forEach((key, value) => result[key] = value.toString());
  return result;
}