getPlaces method

Future<List<MapBoxPlace>> getPlaces(
  1. String queryText
)

Implementation

Future<List<MapBoxPlace>> getPlaces(String queryText) async {
  String url = _createUrl(queryText);
  final response = await http.get(Uri.parse(url));

  if (response.body.contains('message')) {
    throw Exception(json.decode(response.body)['message']);
  }
  return Predictions.fromRawJson(response.body).features;
}