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, TaxonomyLabel> convertResults(dynamic jsonData) {
if (jsonData is! Map<String, dynamic>) {
return const {};
}
return jsonData.map<String, TaxonomyLabel>((String key, dynamic taxonomy) {
if (taxonomy is! Map<String, dynamic>) {
assert(false, 'Received JSON Label is not a Map');
return MapEntry(key, TaxonomyLabel.fromJson({}));
}
return MapEntry(key, TaxonomyLabel.fromJson(taxonomy));
});
}