Code Monkey home page Code Monkey logo

Comments (5)

ma3az33 avatar ma3az33 commented on July 20, 2024 1

@pratik037 you can use this method Geocoder.google(Your_google_key").findAddressesFromCoordinates() instaded of Geocoder.findAddressesFromCoordinates() it will work

from flutter_google_places.

sergioahv15 avatar sergioahv15 commented on July 20, 2024 1

I had the same issue. Thanks @ma3az33, it works!
Does anyone know why Geocoder.local.findAddressesFromCoordinates() is not working?

from flutter_google_places.

pratik037 avatar pratik037 commented on July 20, 2024

Code Implementation

class _SearchBarState extends State<SearchBar> {
  GoogleMapsPlaces _places = GoogleMapsPlaces(apiKey: apiKey);

  @override
  Widget build(BuildContext context) {
    return FloatingActionButton(
      mini: true,
      heroTag: "ssearch",
      onPressed: () async {
        Prediction p =
            await PlacesAutocomplete.show(context: context, apiKey: apiKey, mode: Mode.overlay);
        displayPrediction(p);
      },
      child: Icon(Icons.search),
    );
  }

  Future<Null> displayPrediction(Prediction p) async {
    if (p != null) {
      PlacesDetailsResponse detail =
          await _places.getDetailsByPlaceId(p.placeId);

      var placeId = p.placeId;
      double lat = detail.result.geometry.location.lat;
      double lng = detail.result.geometry.location.lng;

      var address = await Geocoder.local.findAddressesFromQuery(p.description);

      print(lat);
      print(lng);
    }
  }
}

from flutter_google_places.

pratik037 avatar pratik037 commented on July 20, 2024

@pratik037 you can use this method Geocoder.google(Your_google_key").findAddressesFromCoordinates() instaded of Geocoder.findAddressesFromCoordinates() it will work

Okay, so we can close this issue now.

from flutter_google_places.

Vaibhav7894 avatar Vaibhav7894 commented on July 20, 2024

It Works for me....!!!!
If issue related with geocoder: ^0.1.1 then just replace with geocoder: ^0.2.1 in pubspec.yaml

from flutter_google_places.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.