getUrlForQuery method

String getUrlForQuery({
  1. required String query,
  2. required String kMapBoxKey,
})

Implementation

String getUrlForQuery({required String query, required String kMapBoxKey}) {
  final _pathString = '/geocoding/v5/mapbox.places/$query.json';
  final url = Uri(
      scheme: 'https',
      host: 'api.mapbox.com',
      path: _pathString,
      queryParameters: {
        'access_token': '$kMapBoxKey',
        'autocomplete': 'true',
      });
  return url.toString();
}