hoc081098 / flutter_google_places_hoc081098

Better flutter_google_places, updated by @hoc081098
https://pub.dev/packages/flutter_google_places_hoc081098
Other
17 stars 33 forks source link

Prediction is not showing in web #7

Open TristateAndroid opened 3 years ago

TristateAndroid commented 3 years ago

When i try to search its give me this error.

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

hoc081098 commented 3 years ago

Please check it https://github.com/fluttercommunity/flutter_google_places/issues/93#issuecomment-628361440

TristateAndroid commented 3 years ago

Hello @hoc081098 above solution is not working for me, I am getting format error

ERROR FormatException: SyntaxError: Unexpected token S in JSON at position 0 dart-sdk/lib/_internal/js_dev_runtime/private/ddcruntime/errors.dart 236:49 throw dart-sdk/lib/_internal/js_dev_runtime/patch/convert_patch.dart 39:5 _parseJson dart-sdk/lib/convert/json.dart 506:36 convert dart-sdk/lib/convert/json.dart 157:41 decode packages/google_maps_webservice/src/places.dart 531:48 [_decodeAutocompleteResponse] packages/google_maps_webservice/src/places.dart 171:12 autocomplete dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50 dart-sdk/lib/async/zone.dart 1612:54 runUnary dart-sdk/lib/async/future_impl.dart 152:18 handleValue dart-sdk/lib/async/future_impl.dart 704:44 handleValueCallback dart-sdk/lib/async/future_impl.dart 733:13 _propagateToListeners dart-sdk/lib/async/future_impl.dart 539:5 [_completeWithValue] dart-sdk/lib/async/future_impl.dart 577:7 callback dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15

and My code

Prediction prediction = await PlacesAutocomplete.show( context: context, apiKey: StringAsset.googleApiKey, mode: Mode.overlay, // Mode.fullscreen language: "es", proxyBaseUrl: "https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api", );

tingwei0520 commented 2 months ago

I got the same situation, just like you. And I followed this to resolve the problem but I didn't commit '--disable-extension'. I just put '--disable-web-security' at the next line of it. https://github.com/hoc081098/flutter_google_places_hoc081098/issues/11#issuecomment-1768521194

By the way, please make sure to restart your chrome all over again to make the magic happen. Once you restart your chrome, you should see an upper banner saying disabling security is unsupported. This means you should be able to use it.