A plugin that give you the access to google places api to search by geolocation and places to autocomplete.


  • Generate a list of locations based on user input and optional parameters;
  • Get Geolocation (lat, lng) from a place, based on place_id


In order to use this plugin you need to add flutter_places_autocomplete to your pubspec.yaml file.

    flutter_places_autocomplete: 0.1.0 


You can get the place Geolocation by passing it's placeId. for example:

import 'package:flutter_places_autocomplete/flutter_places_autocomplete.dart';

Geolocation geolocation = await PacesAutocomplete(apikey: 'YOUR_API_KEY').getGeolocation(placeId: 'ChIJdd4hrwug2EcRmSrV3Vo6llI');

You can also retrive the the geolocation in string format lat,lng:

Geolocation geolocation = await PacesAutocomplete(apikey: 'YOUR_API_KEY').getGeolocation(placeId: 'ChIJdd4hrwug2EcRmSrV3Vo6llI');


You can also set optional parameters to the search

fieldsYou can specify which fields of the search you want to bring.
sessionTokenA random string which identifies an autocomplete session for billing purposes

The Basic category includes the following fields: address_component, adr_address, formatted_address, geometry, icon, name, permanently_closed, photo, place_id, plus_code, type, url, utc_offset, vicinity

The Contact category includes the following fields: formatted_phone_number, international_phone_number, opening_hours, website

The Atmosphere category includes the following fields: price_level, rating, review, user_ratings_total


You can retrieve a list of possible predictions for an input. for example:

import 'package:flutter_places_autocomplete/flutter_places_autocomplete.dart';

Predictions predictions = await PacesAutocomplete(apikey: 'YOUR_API_KEY').gerPredictions(input: 'London');

It will retrieve a List<Prediction> which contains

descriptionThe human-readable name for the returned result.
place_idA textual identifier that uniquely identifies a place.
typesAn array of types that apply to this place.
termsAn array of terms identifying each section of the returned description
geolocationA geolocation object containing lat, lng for the place

You can set the following parameters:

languageThe language code, indicating in which language the results should be returned
locationThe point around which you wish to retrieve place information. Must be specified as lat,lng.
typesThe types of place results to return.
strictboundsPlaces that are strictly within the region defined by location and radius