PlaceResponse.fromJson constructor

PlaceResponse.fromJson(
  1. dynamic json
)

Implementation

factory PlaceResponse.fromJson(dynamic json) {
  var responseDataJson = json['data'] as List;
  List<Place> _placeResults = responseDataJson
      .map((searchJson) => Place.fromJson(searchJson))
      .toList();

  return PlaceResponse(
    json['timestamp'] as String,
    json['status'] as int,
    json['message'] as String,
    _placeResults,
  );
}