https://github.com/filledstacks/places_service
a wrapper for the places functionality to improve the usability of it
https://github.com/filledstacks/places_service
Last synced: 9 months ago
JSON representation
a wrapper for the places functionality to improve the usability of it
- Host: GitHub
- URL: https://github.com/filledstacks/places_service
- Owner: FilledStacks
- License: mit
- Created: 2021-05-04T12:43:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-16T21:25:47.000Z (over 1 year ago)
- Last Synced: 2025-04-16T06:43:46.506Z (9 months ago)
- Language: Dart
- Size: 174 KB
- Stars: 11
- Watchers: 4
- Forks: 20
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```dart
_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.
```dart
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.
```dart
final placeDetails = await _placesService.getPlaceDetails('ID_FROM_AUTO_COMPLETE');
```