mapValue static method

Map<String, dynamic>? mapValue(
  1. Map<String, dynamic>? info,
  2. String key
)

Implementation

static Map<String,dynamic>? mapValue(Map<String,dynamic>? info, String key) {
  if (info == null) { return null; }
  final map = info[key];
  if (map != null && map is Map<String,dynamic>) {
    return map;
  } else if (map != null && map is Map) {
    Map<String,dynamic> jsonData = {};
    for (dynamic key in map.keys) {
      if (key is String) {
        jsonData[key] = map[key];
      }
    }
    return jsonData;
  }
  return null;
}