asMap function

Map<String, dynamic> asMap(
  1. Map<String, dynamic>? json,
  2. String key, {
  3. Map<String, dynamic>? defaultValue,
})

Implementation

Map<String, dynamic> asMap(Map<String, dynamic>? json, String key,
    {Map<String, dynamic>? defaultValue}) {
  if (json == null || !json.containsKey(key)) {
    return defaultValue ?? <String, dynamic>{};
  }
  return toMap(json[key]);
}