bazrafkan / google_place

A new Flutter package for handle google place api
MIT License
84 stars 122 forks source link

Place search not working on the web #14

Closed angwandi closed 2 years ago

angwandi commented 3 years ago

Places search and the overall package does not work on the web

khuongdn16 commented 3 years ago

I also run into this issue.

tomrozb commented 3 years ago

@bazrafkan would be great to remove "web" tag from pub.dev. I also run into this issue, just wasted 2h to realize web is not supported :)

LucaDillenburg commented 3 years ago

Does somebody know why it's not supported? I really needed it for the web. Does any body know any other solution?

sarbogast commented 3 years ago

As a workaround, here is what I ended up doing.

    final places = new GoogleMapsPlaces(
        apiKey: googlePlacesApiKey,
        baseUrl: kIsWeb
            ? 'https://[heroku app name].herokuapp.com/https://maps.googleapis.com/maps/api'
            : null,
      );

Note that you shouldn't use https://cors-anywhere.herokuapp.com as a proxy because it is a test set up, not meant to be used in real applications. I suspect that's why this proxy gets a FormatException.

bazrafkan commented 2 years ago

Now supported web implementation in version 0.4.2

abdulrehmank7 commented 2 years ago

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