-
-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when using [selectedPlaceWidgetBuilder] with MediaQuery #30
Comments
Hi @RicardoRB , I think it is because of MediaQuery since it rebuilds your widget. Try to put something like:
instead of MediaQuery. |
Hi @fysoul17 That's the trick! Thanks! |
This was referenced May 10, 2020
fysoul17
changed the title
selectedPlaceWidgetBuilder not move the map when search by top bar
Issue when using [selectedPlaceWidgetBuilder] with MediaQuery
May 11, 2020
This was referenced Aug 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When the selectedPlaceWidgetBuilder is overridden and want to search an address by the top bar, it doesn't move the map to the found address.
To Reproduce
Steps to reproduce the behavior:
Rewrite selectedPlaceWidgetBuilder:
Example:
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
return isSearchBarFocused
? Container()
// Use FloatingCard or just create your own Widget.
: FloatingCard(
bottomPosition: MediaQuery.of(context).size.height * 0.05,
leftPosition: MediaQuery.of(context).size.width * 0.05,
width: MediaQuery.of(context).size.width * 0.9,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching ?
Center(child: CircularProgressIndicator()) :
RaisedButton(onPressed: () { print("do something with [selectedPlace] data"); },),
);
},
Click on top bar
Write a address
Click the address
You get the adress but the map doesn't move to the selected address
Expected behavior
When the user selects the address in top bar, the map should move there
Flutter Doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Linux, locale en_US.UTF-8)
• Flutter version 1.12.13+hotfix.9 at /home/ricardo/flutter
• Framework revision f139b11009 (4 weeks ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /home/ricardo/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• Java binary at: /snap/android-studio/88/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Android Studio (version 3.6)
• Android Studio at /snap/android-studio/88/android-studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (1 available)
• Redmi 4X • 6f9199b7d440 • android-arm64 • Android 7.1.2 (API 25)
• No issues found!
The text was updated successfully, but these errors were encountered: