listFromJson static method

List<GeoShape> listFromJson(
  1. List? json
)

Implementation

static List<GeoShape> listFromJson(List<dynamic>? json) {
  if (json == null) {
    return <GeoShape>[];
  }

  return json.fold(<GeoShape>[], (List<GeoShape> previousValue, element) {
    final GeoShape? object = GeoShape.fromJson(element);
    if (object is GeoShape) {
      previousValue.add(object);
    }

    return previousValue;
  });
}