PlaceDetails.fromJson constructor
PlaceDetails.fromJson(
- Map<String, dynamic> json
)
Implementation
PlaceDetails.fromJson(Map<String, dynamic> json) {
formatted_address = json['formatted_address'];
geometry = json.containsKey('geometry') && json['geometry'] != null
? Geometry.fromJson(json['geometry'])
: null;
place_id = json['place_id'];
address_components = json.containsKey('address_components') && json['address_components'] != null
? (json['address_components'] as List)
.map((data) => LocationPiece.fromJson(data))
.toList()
: null;
}