convertResults method
Creates a map of the correct taxonomy type from the raw JSON data.
Subclasses must implement this to return concrete taxonomy objects.
Implementation
@override
Map<String, TaxonomyLanguage> convertResults(dynamic jsonData) {
if (jsonData is! Map<String, dynamic>) {
return const {};
}
return jsonData
.map<String, TaxonomyLanguage>((String key, dynamic taxonomy) {
if (taxonomy is! Map<String, dynamic>) {
assert(false, 'Received JSON Language is not a Map');
return MapEntry(key, TaxonomyLanguage.fromJson({}));
}
return MapEntry(key, TaxonomyLanguage.fromJson(taxonomy));
});
}