Prediction.fromJSON constructor

Prediction.fromJSON(
  1. Map<String, dynamic> place,
  2. Geolocation geolocation
)

Implementation

Prediction.fromJSON(Map<String, dynamic> place, Geolocation geolocation) {
  this.description = place['description'];
  this.placeId = place['place_id'];
  this.types = (place['types'] as List).join(',');
  this.terms = (place['terms'] as List).map((term) => term.value).toList();
  this.geolocation = geolocation;
}