fysoul17 / google_maps_place_picker

Place picker on Google Maps for Flutter
MIT License
223 stars 364 forks source link

Select Autocomplete is not working #27

Closed jefferyleo closed 4 years ago

jefferyleo commented 4 years ago

The google map is loaded without any issue, however when I selected the autocomplete from search result, it wouldn't move the map to the selected autocomplete location instead of staying at the current location.

To Reproduce Steps to reproduce the behavior:

  1. Load the google map
  2. Search any location in the search bar
  3. Click the search location result autocomplete
  4. The error is occur

Screenshots Google Autocomplete error.zip I've screen recording the error from my phone *Sorry for the noise of the video As you can see in the video, after I choose the autocomplete result, it just return to the map with current location.

Flutter Doctor -v

[flutter] flutter doctor -v [√] Flutter (Channel master, v1.16.3, on Microsoft Windows [Version 10.0.17763.1098], locale en-US) • Flutter version 1.16.3 at C:\Users\JefferyLeo\Documents\Flutter\flutter • Framework revision be3a4b37b3 (3 weeks ago), 2020-03-26 18:08:05 -0700 • Engine revision b2bdeb3f0f • Dart version 2.8.0 (build 2.8.0-dev.17.0 1402e8e1a4)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.0) • Android SDK at C:\Users\JefferyLeo\AppData\Local\Android\Sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03) • All Android licenses accepted.

[√] Android Studio (version 3.5) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 43.0.1 • Dart plugin version 191.8593 • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.44.1) • VS Code at C:\Users\JefferyLeo\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.9.1

[√] Connected device (1 available) • SM N950F • ce0817180d63385d0c7e • android-arm64 • Android 8.0.0 (API 26)

• No issues found! exit code 0

Additional Remarks I've tried with Flutter Clean, Reinstall the app, it's still the same thing happened.

minSdkVersion 16 targetSdkVersion 28

fysoul17 commented 4 years ago

Hi,

It seems like you are using the widget with MediaQuery which will re-build the widget when the keyboard pops up. It is intended behaviour of MediaQuery widget, please refer to the link.

Querying the current media using MediaQuery.of will cause your widget to rebuild automatically whenever the MediaQueryData changes (e.g., if the user rotates their device).

If you are not using MediaQuery, some other parent widget is triggering re-build and thus the PlacePicker is reloading the map every time.

fysoul17 commented 4 years ago

Closing as there is no further update.

Please feel free to post an update to re-open the issue.