load method

  1. @override
Future<Map<String, dynamic>> load(
  1. String path,
  2. Locale locale
)

Implementation

@override
Future<Map<String, dynamic>> load(String path, Locale locale) async {
  log('easy localization loader: load http $path');
  try {
    var url = Uri.parse('$path/${locale.toLanguageTag()}.json');
    return http
        .get(url)
        .then((response) => json.decode(utf8.decode(response.bodyBytes)));
  } catch (e) {
    //Catch network exceptions
    return {};
  }
}