class LocationApiResponse { final List results; LocationApiResponse({ required this.results, }); LocationApiResponse copyWith({ required List results, }) { return LocationApiResponse( results: results, ); } factory LocationApiResponse.fromMap(Map map) { return LocationApiResponse( results: (map['results']) == null ? [] : List.from( (map['results']).map( (x) => LocationDataFromResponse.fromMap(x as Map), ), ), ); } } class LocationDataFromResponse { final String place; final List bbox; LocationDataFromResponse({ required this.place, required this.bbox, }); factory LocationDataFromResponse.fromMap(Map map) { return LocationDataFromResponse( place: map['place'] as String, bbox: List.from( (map['bbox']), ), ); } }