MapBoxPlace.fromJson constructor

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

Implementation

factory MapBoxPlace.fromJson(Map<String, dynamic> json) => MapBoxPlace(
      id: json["id"] == null ? null : json["id"],
      type: json["type"] == null ? null : featureTypeValues.map[json["type"]],
      placeType: json["place_type"] == null
          ? null
          : new List<PlaceType>.from(
              json["place_type"].map((x) => placeTypeValues.map[x])),
      // relevance: json["relevance"] == null ? null : json["relevance"],
      properties: json["properties"] == null
          ? null
          : Properties.fromJson(json["properties"]),
      text: json["text"] == null ? null : json["text"],
      placeName: json["place_name"] == null ? null : json["place_name"],
      bbox: json["bbox"] == null
          ? null
          : new List<double>.from(json["bbox"].map((x) => x.toDouble())),
      center: json["center"] == null
          ? null
          : new List<double>.from(json["center"].map((x) => x.toDouble())),
      geometry: json["geometry"] == null
          ? null
          : Geometry.fromJson(json["geometry"]),
      context: json["context"] == null
          ? null
          : new List<Context>.from(
              json["context"].map((x) => Context.fromJson(x))),
      matchingText:
          json["matching_text"] == null ? null : json["matching_text"],
      matchingPlaceName: json["matching_place_name"] == null
          ? null
          : json["matching_place_name"],
    );