FlutterGooglePlacesSdk class

Client used to call methods on the native google places sdk

Constructors

FlutterGooglePlacesSdk.new(String _apiKey, {Locale? locale, bool useNewApi = false})
Construct a FlutterGooglePlacesSdk using the specific api key and locale

Properties

apiKey String
The Places API key https://developers.google.com/maps/documentation/places/android-sdk/get-api-key
no setter
hashCode int
The hash code for this object.
no setterinherited
locale Locale?
The locale in which Places API responses will be localized. If null, the device locale at the point of request is used.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetchPlace(String placeId, {required List<PlaceField> fields}) Future<FetchPlaceResponse>
Fetches the details of a place. Only the requested fields will be returned. If none specified, all fields will be returned.
fetchPlacePhoto(PhotoMetadata photoMetadata, {int? maxWidth, int? maxHeight}) Future<FetchPlacePhotoResponse>
Fetches a photo of a place.
findAutocompletePredictions(String query, {List<String>? countries, List<PlaceTypeFilter> placeTypesFilter = const [], bool? newSessionToken, LatLng? origin, LatLngBounds? locationBias, LatLngBounds? locationRestriction}) Future<FindAutocompletePredictionsResponse>
Fetches autocomplete predictions based on a query.
isInitialized() Future<bool?>
Returns whether or not the client has been initialized.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateSettings({String? apiKey, Locale? locale, bool? useNewApi}) Future<void>
Updates the settings of the places client with the given API key and locale. If apiKey is null, the last key will be used. If locale is null, it will not be updated.

Operators

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

Static Properties

platform FlutterGooglePlacesSdkPlatform
Singleton instance to the platform
getter/setter pair

Constants

ASSET_POWERED_BY_GOOGLE_ON_NON_WHITE → const AssetImage
"Powered by google" image that should be used when background is not white
ASSET_POWERED_BY_GOOGLE_ON_WHITE → const AssetImage
"Powered by google" image that should be used when background is white