places_service 0.1.4 copy "places_service: ^0.1.4" to clipboard
places_service: ^0.1.4 copied to clipboard

A service that makes it easy to get information from the Places Api

Places Service #

A service that Wraps the Google places Api through the google_maps_webservice package and provides an easy interface to work with and handle in your code.

How To use #

Initialise #

To start off you have to call initialise an pass in your api key

   _placesService.initialize(
      apiKey: 'PUT_YOUR_KEY_HERE',
    );

If you're using the setup recommended by FilledStacks this can be done in the StartUpViewModel.

Get Automcomplete Suggestions #

When this is complete you can get your Suggestions for an address using the getAutoComplete function.

final autoCompleteSuggestions = await _placesService.getAutoComplete('cape town');

That will return a list of auto complete suggestions to you.

Get Places Details #

Once you have the places id you want to get you can make a request to getPlaceDetails to get all the details google has available for that place.

final placeDetails = await _placesService.getPlaceDetails('ID_FROM_AUTO_COMPLETE');
24
likes
110
pub points
88%
popularity

Publisher

verified publisherfilledstacks.com

A service that makes it easy to get information from the Places Api

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, freezed_annotation, geolocator, google_maps_webservice_ex, json_annotation, uuid

More

Packages that depend on places_service