GooglePlacesAutocomplete class

A service class to interact with the Google Places API.

Provides functionality to fetch autocomplete predictions and detailed place information based on user queries and place IDs.

Constructors

GooglePlacesAutocomplete.new({required ListnerAutoCompletePredictions predictionsListner, required String apiKey, ListnerLoadingPredictions? loadingListner, int debounceTime = 300, List<String>? countries, List<String>? primaryTypes, String? language})
Constructs a GooglePlacesAutocomplete instance.

Properties

apiKey String
The Google Places API key required to make requests.
final
countries List<String>?
A list of country codes to filter predictions.
final
debounceTime int
The time delay (in milliseconds) to debounce user input for predictions.
final
hashCode int
The hash code for this object.
no setterinherited
language String?
The language code for predictions, e.g., en, fr, es.
final
loadingListner → ListnerLoadingPredictions?
Callback listner for delivering loading status.
final
predictionsListner → ListnerAutoCompletePredictions
Callback listner for delivering autocomplete predictions to the UI.
final
primaryTypes List<String>?
A list of primary types to filter predictions.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getPredictionDetail(String placeId) Future<PlaceDetails?>
Fetches detailed information for a specific place using its Place ID.
getPredictions(String query) → void
Fetches autocomplete predictions based on the user query.
initialize() → void
Initializes the service and sets up the stream for debouncing user input.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited