bazrafkan / google_place

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

flutter web return null value #36

Open lost-codee opened 2 years ago

lost-codee commented 2 years ago

in flutter web, all requests are retuning null value.

marcoAtEnvidual commented 2 years ago

Same here :S works fine on iOS/android. I noticed that it does not really ever throw any exceptions. :S Those would be quite helpful (because with web it might just be a cors issue).

marcoAtEnvidual commented 2 years ago

The error thrown is XMLHttpRequest.

To Solve Flutter Web getting 'XMLHttpRequest' error while making HTTP call Error Most cases of this error just add Access-Control-Allow-Origin value in the header might resolve the issue. Just make sure to replace all Underscore by Dash.

og1-alarm commented 2 years ago

@bazrafkan can you please look into this issue? @marcoAtEnvidual I tried adding headers: {'Access-Control-Allow-Origin': '*'} but no luck with this workaround.

marcoAtEnvidual commented 2 years ago

@og1-alarm I eventually got it working by dropping the plugin and writing my own micro service and routing the calls through that one. :S not an elegant solution but we were pressed for time

RageshAntony commented 2 years ago

in flutter web, all requests are retuning null value.

https://stackoverflow.com/questions/65630743/how-to-solve-flutter-web-api-cors-error-only-with-dart-code

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

pradeep14598 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

is this working on Flutter web?

mattostanik commented 2 years ago

I'm experiencing the same issue. In Flutter web, all requests are returning null value. Since this has been an open issue for over 8 months, this package should not be advertised as working for Flutter web. I moved to flutter_google_places_sdk instead.