maps_places_autocomplete

Creator: coderz1093

Last updated:

Add to Cart

Description:

maps places autocomplete

This is a simple implementation of google maps places autocomplete.
Features #
List suggestions of places by search
O click get place details mapped
Getting started #
A complete sample of use inside example folder
Usage #
Look at example folder main an example of use
to /example folder.
import the lim and model
import 'package:maps_places_autocomplete/maps_places_autocomplete.dart';
import 'package:maps_places_autocomplete/model/place.dart';
copied to clipboard
write a callback function
void onSuggestionClick(Place placeDetails) {
setState(() {
_streetNumber = placeDetails.streetNumber;
_street = placeDetails.street;
_city = placeDetails.city;
_state = placeDetails.state;
_zipCode = placeDetails.zipCode;
_country = placeDetails.country;
_vicinity = placeDetails.vicinity;
_lat = placeDetails.lat;
_lng = placeDetails.lng;
});
}
copied to clipboard
include the package widget, configure language and country restriction
languange and country are optional
insert your google places api key
MapsPlacesAutocomplete(
mapsApiKey: 'YOUR KEY HERE',
onSuggestionClick: onSuggestionClick,
componentCountry: 'br',
language: 'pt-BR'
),
copied to clipboard
Additional information #
This package implements the oficial documention of google maps places api
and use address as types and receive a detail with address_component and geometry as fields only

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.