Open TristateAndroid opened 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
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", );
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.
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