onAutoCompletion method

Future<Response> onAutoCompletion(
  1. String term,
  2. String googleMapApiKey,
  3. String language
)

Sends a request to the Google Places API to get auto-completion suggestions.

  • term: The input term for which auto-completion suggestions are requested.
  • googleMapApiKey: The API key for accessing Google Places services.
  • language: The language code for the suggestions (e.g., 'en' for English, 'fr' for French).

Returns a Future that resolves to a Response object containing the API response.

Throws an exception if the API request fails or if there is a network issue.

Implementation

Future<Response> onAutoCompletion(
    String term, String googleMapApiKey, String language) async {
  return await ApiProvider.instance.get(
    endpoint: "$endpoint$term&key=$googleMapApiKey&language=$language",
  );
}