fluttercommunity / flutter_google_places

Google Places - Google places autocomplete widgets for flutter. No wrapper, use https://pub.dev/packages/google_maps_webservice. Maintainer: @juliansteenbakker
https://pub.dev/packages/flutter_google_places
Other
303 stars 415 forks source link

XMLHttpRequest error on Flutter web #163

Closed bibash28 closed 2 years ago

bibash28 commented 3 years ago

Code: Prediction prediction = await PlacesAutocomplete.show( context: context, logo: Container(height: 1), apiKey: googleApiKey, hint: S.of(context).Search_Address, mode: Mode.overlay, language: languageCode, components: [Component(Component.country, "us")], location: Location(lat: userLocation.latitude, lng: userLocation.longitude), strictbounds: false, types: [], onError: (e) => showSnackBar(context, e.errorMessage), );

Error : Error: XMLHttpRequest error. C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 906:28 get current packages/http/src/browser_client.dart 71:22 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/zone.dart 1612:54 runUnary C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 152:18 handleValue C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 704:44 handleValueCallback C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 733:13 _propagateToListeners C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/future_impl.dart 530:7 [_complete] C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream_pipe.dart 61:11 _cancelAndValue C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/async/stream.dart 1219:7 C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14 _checkAndCall C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39 dcall C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/html/dart2js/html_dart2js.dart 37307:58

at Object.createErrorWithStack (http://localhost:57008/dart_sdk.js:5347:12)
at Object._rethrow (http://localhost:57008/dart_sdk.js:39349:16)
at async._AsyncCallbackEntry.new.callback (http://localhost:57008/dart_sdk.js:39343:13)
at Object._microtaskLoop (http://localhost:57008/dart_sdk.js:39175:13)
at _startMicrotaskLoop (http://localhost:57008/dart_sdk.js:39181:13)
at http://localhost:57008/dart_sdk.js:34688:9    
KevMorelli commented 3 years ago

@bibash28 It's a CORS issue.

For now the fastest way to fix it it's here https://github.com/fluttercommunity/flutter_google_places/issues/93#issuecomment-652261230

minhduc1827 commented 3 years ago

Hello all, is issue fixed because when i use the heroku proxy it's very limit reading. Thanks all

jtmuller5 commented 3 years ago

Any update on this?

achinverma commented 3 years ago

i am also getting the same issue, Please suggest fix asap.

juliansteenbakker commented 2 years ago

Duplicate of #93, for now web is not supported.