mapFromJson static method

Map<String, GeoShape> mapFromJson(
  1. Map<String, dynamic>? json
)

Implementation

static Map<String, GeoShape> mapFromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return <String, GeoShape>{};
  }

  return json.entries.fold(<String, GeoShape>{},
      (Map<String, GeoShape> previousValue, element) {
    final GeoShape? object = GeoShape.fromJson(element.value);
    if (object is GeoShape) {
      previousValue[element.key] = object;
    }

    return previousValue;
  });
}