forwardSearch method
Future<List<PhotonFeature> >
forwardSearch(
- String searchText, {
- bool secure = true,
- PhotonForwardParams params = const PhotonForwardParams(),
Does a forward search with the given searchText
.
The search can be improved or further influenced by specifying a set of params
.
If secure
is set to false, requests will be performed via HTTP, otherweise HTTPS is used (default).
Throws an exception if the API response has a status code different than 200.
Implementation
Future<List<PhotonFeature>> forwardSearch(String searchText,
{bool secure = true,
PhotonForwardParams params = const PhotonForwardParams()}) async {
var queryParams = params.buildQueryParameters();
queryParams['q'] = searchText;
final uri = secure
? Uri.https(
_baseUri.authority, _baseUri.path + _forwardEndpoint, queryParams)
: Uri.http(
_baseUri.authority, _baseUri.path + _forwardEndpoint, queryParams);
final res = await http.get(uri);
return _handleResponse(res);
}