Giter VIP home page Giter VIP logo

Comments (10)

bazrafkan avatar bazrafkan commented on August 20, 2024 4

Already you can set country in this package that set in components .
for example set country like France:
components: [Component("country","fr")]

Example:

var googlePlace = GooglePlace("Your-Key"); var risult = await googlePlace.autocomplete.get("1600 Amphitheatre", components: [Component("country","fr")]);

from google_place.

muneebahmad0600 avatar muneebahmad0600 commented on August 20, 2024

Same.. need feature asap if possible.

from google_place.

rvndsngwn avatar rvndsngwn commented on August 20, 2024

@muneebahmad0600 I'm now using this package https://pub.dev/packages/flutter_google_places.

from google_place.

muneebahmad0600 avatar muneebahmad0600 commented on August 20, 2024

the documentation and example are both vague in that package. I tried using that package before this one. do u mind sharing the code for prediction listing? its multiple modes are kind of throwing me off a bit.

from google_place.

rvndsngwn avatar rvndsngwn commented on August 20, 2024

@muneebahmad0600 you can see full example with null safety of both packages: - https://gist.github.com/rvndsngwn/e2b11f8733e244e477925d7c186bd334

from google_place.

muneebahmad0600 avatar muneebahmad0600 commented on August 20, 2024

Bro this the same code as the example which doesn't show how to restrict to a country. what I wanted to see was how you restrict the autoCompleteSearch() function to a country. if you are using the different library you mentioned above. please share that code.

from google_place.

rvndsngwn avatar rvndsngwn commented on August 20, 2024
  Prediction? p = await PlacesAutocomplete.show(
      context: context,
      apiKey: kGoogleApiKey,
      onError: onError,
      mode: _mode,
      language: "en",
      components: [Component(Component.country, "IN")],
    );

In components you can specify witch country you allow like:- [Component(Component.country, "IN"),Component(Component.country, "AU"),Component(Component.country, "CA"),],

from google_place.

rvndsngwn avatar rvndsngwn commented on August 20, 2024

you can restrict a country from your firebase.

from google_place.

tiagoon avatar tiagoon commented on August 20, 2024

var googlePlace = GooglePlace("Your-Key"); var risult = await googlePlace.autocomplete.get("1600 Amphitheatre", components: [Component("country","fr")]);

Thanks! If you can put this information in the readme it will be very useful.

from google_place.

abdulrehmank7 avatar abdulrehmank7 commented on August 20, 2024

Instead of using this plugin, I created a utility class for Google places auto complete : https://arkapp.medium.com/flutter-and-google-map-for-beginners-part-1-fdba4ab22148

from google_place.

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.