fieldsAsMap function
Implementation
Map<String, Map<String, dynamic>> fieldsAsMap(Map<String, dynamic> obj) {
return Map.fromEntries(((obj['fields'] as List?) ?? []).map((e) {
final val = e as Map<String, dynamic>;
return MapEntry(val['name'], val);
}));
}