load method
The returned Future will wait until the JSON asset is loaded and processed and then resolve with resulting values.
Implementation
@override
Future<Map<String, String>> load(
String language,
Translator translator,
) async {
final data = await rootBundle.loadString(
package?.isNotEmpty == true ? 'packages/$package/$asset' : asset,
);
final result = <String, String>{};
final converted = json.decode(data);
converted?.forEach((key, value) => result[key] = value.toString());
return result;
}