Prediction.fromJson constructor

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

Implementation

Prediction.fromJson(Map<String, dynamic> json) {
  description = json['description'];
  id = json['id'];
  if (json['matched_substrings'] != null) {
    matchedSubstrings = [];
    json['matched_substrings'].forEach((v) {
      matchedSubstrings!.add(new MatchedSubstrings.fromJson(v));
    });
  }
  placeId = json['place_id'];
  reference = json['reference'];
  structuredFormatting = json['structured_formatting'] != null
      ? new StructuredFormatting.fromJson(json['structured_formatting'])
      : null;
  if (json['terms'] != null) {
    terms =[];
    json['terms'].forEach((v) {
      terms!.add(new Terms.fromJson(v));
    });
  }
  types = json['types'].cast<String>();
  lat = json['lat'];
  lng = json['lng'];
}