fluttercommunity / fluttercommunity/flutter_google_places

New way of getting lat and long?

Open
#170 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
312
Forks
462
PR merge metrics
No merged PRs in 30d

Description

Hey there,

I was using flutter_google_places to query lat and lon information from locations but it seems the new version has changed the way to use the widgets.

In the previous version I was doing something like this

```
GooglePlaceAutoCompleteTextField(
textEditingController:textControllerReport,
googleAPIKey: "apikey",
inputDecoration: InputDecoration(
hintText: 'Direccion del Reporte'
),
debounceTime: 800, // default 600 ms,
countries: ["mx"],// optional by default null is set
isLatLngRequired:true,// if you required coordinates from place detail
getPlaceDetailWithLatLng: (prediction) {
// this method will return latlng with place detail
print(prediction.description);
print("placeDetails" + prediction.lng.toString());
print("placeDetails" + prediction.lat.toString());
}, // this callback is called when isLatLngRequired is true
itmClick: (prediction) {
print(prediction);
textControllerReport.text=prediction.description;
textControllerReport.selection = TextSelection.fromPosition(TextPosition(offset: prediction.description.length));
},

)
```

Is there a way to do the same on version 3 of google_places?
Thanks!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.