Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting the Place Details using AutoCompleteTextField #25

Closed
makkasbed opened this issue Oct 8, 2018 · 2 comments
Closed

Getting the Place Details using AutoCompleteTextField #25

makkasbed opened this issue Oct 8, 2018 · 2 comments

Comments

@makkasbed
Copy link

Hello,

Is there a way to get the place details using autocompletetextfield of this plugin?

Regards,

@lejard-h
Copy link
Collaborator

lejard-h commented Oct 9, 2018

not directly with the library.

check the example
https://github.com/lejard-h/flutter_google_places/blob/master/example/lib/main.dart

It use package:google_maps_webservice/places.dart to get place details here

@savasadar
Copy link

savasadar commented Mar 12, 2020

Future<Null> displayPrediction(Prediction p, ScaffoldState scaffold) async {
  if (p != null) {
    // get detail (lat/lng)
    PlacesDetailsResponse detail = await _places.getDetailsByPlaceId(p.placeId);
    final lat = detail.result.geometry.location.lat;
    final lng = detail.result.geometry.location.lng;

    scaffold.showSnackBar(
      SnackBar(content: Text("${p.description} - $lat/$lng")),
    );
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants