GeographicArea.fromJson constructor

GeographicArea.fromJson(
  1. Map<String, dynamic> json
)

Deserializes a JSON-compatible map to create an instance.

Used internally, not intended for direct use by consumers. The expected map structure may change without notice.

Implementation

factory GeographicArea.fromJson(final Map<String, dynamic> json) {
  switch (json['type']) {
    case 1:
      return CircleGeographicArea.fromJson(json);
    case 2:
      return RectangleGeographicArea.fromJson(json);
    case 3:
      return PolygonGeographicArea.fromJson(json);
    default:
      return RectangleGeographicArea(
        topLeft: Coordinates(),
        bottomRight: Coordinates(),
      );
  }
}