geoCodingAutoComplete method
geoCodingAutoComplete provides better results for address searches with fewer keystrokes
query
is the mandatory parameter. The Results is returned on the basis of query
maxResults
can be given to restrict the suggestions based on query
The valid value of maxResults
is between 1 to 10
Implementation
Future<Map<String, dynamic>> geoCodingAutoComplete({
required String query,
int maxResults = 1,
}) async {
assert(maxResults >= 1 && maxResults <= 10, 'maxResults must be between 1 and 10');
final headers = _createHeader();
final data = _createMap();
data['query'] = query;
data['maxResults'] = '$maxResults';
var uri = Uri.https('autocomplete.geocoder.ls.hereapi.com', '/6.2/suggest.json', data);
return _callHereApi(uri, headers);
}