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
[CupertinoPageRoute] Gestures don't respond when clicking immediately after swiping back #73026
Comments
Tried your code sample on iPhoneSE simulator, but didn't notice the issue. I was able to swipe from second screen to first properly. 73026.movflutter doctor -v
Do you see the same behavior on physical device also ? |
I think your sliding range is too large. Try to release it when sliding to the middle, or use a real machine to simulate the side-slip effect, it is very easy to appear |
video.17.mov |
flutter doctor -v
|
CC @xster |
cc @dkwingsmt |
flutter doctor -v[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
• Flutter version 2.0.1 at /Users/tahatesser/Code/flutter_stable
• Framework revision c5a4b4029c (4 days ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Volumes/Extreme/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Volumes/Extreme/SDK
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.54.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0
[✓] Connected device (3 available)
• Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.4
• macOS (desktop) • macos • darwin-x64 • macOS 11.2.2 20D80 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192
• No issues found! [✓] Flutter (Channel master, 2.1.0-11.0.pre.145, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
• Flutter version 2.1.0-11.0.pre.145 at /Users/tahatesser/Code/flutter_master
• Framework revision a0ba646408 (3 days ago), 2021-03-05 22:09:03 -0500
• Engine revision f751d04fa0
• Dart version 2.13.0 (build 2.13.0-107.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Volumes/Extreme/SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /Volumes/Extreme/SDK
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.54.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0
[✓] Connected device (3 available)
• Taha’s iPhone (mobile) • 00008020-001059882212002E • ios • iOS 14.4
• macOS (desktop) • macos • darwin-x64 • macOS 11.2.2 20D80 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192
• No issues found! |
I can confirm this is an issue. I've recorded a video that shows different types opening&closenings: https://vimeo.com/521522681
I've modified the original minimally to make it stateful (and hence have the dispose function) Expand code here
flutter doctor -v[✓] Flutter (Channel beta, 1.26.0-17.8.pre, on macOS 11.2.2 20D80 darwin-x64, locale en-GB) • Flutter version 1.26.0-17.8.pre at /Users/mariusgrimstad/dev/flutter • Framework revision 044f2cf (13 days ago), 2021-02-24 13:02:05 -0800 • Engine revision 042c82b • Dart version 2.12.0 (build 2.12.0-259.16.beta)[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.0) [✓] VS Code (version 1.53.2) [✓] Connected device (2 available) • No issues found! |
Looking at it more in detail it seems like animation curve combined with the inner workings of route might be the problem here. https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/cupertino/route.dart#L735 Currently the dismissal animation is using the curve I added some debug traces to see the animation-value and timestamps, here's a snippet how it looks close to the end of the animation.
As you can see, the value is almost 0 ( == barely visible at the very right edge) for about 300ms before the AnimationStatus is equal to dismissed. This means it will look like it is popped, but is still there. Only when the status has changed to AnimationStatus.dismissed, it will call Digging further it turns out stopGesture actually blocks user-input. This means it will by the current design block any input for some time (even though the user is not seeing anything of the previous modal) before the user can interact again. The time will depend on how far to the right you drop it, so if you drop it far to the right it will barely affect the user, but if you make a quick swipe-to-dismiss on the left side on the screen, the user will be heavily affected. |
@chunhtai @TahaTesser @gspencergoog I found that this issue was the reason for blocking the user-input during the userGesture. I tried to remove this line and can confirm the feeling was much smoother as a new tap on the previous page would respond immediately. (However with some side-effects afterwards of course). Do you have any suggestion on how to solve this in another way where it doesn't have to be blocked? Currently the feeling is not smooth as some taps are not responding, specially when using an actual device. |
I believe it's not CupertinoPageRoute specific either, because this fixed the issue for me. |
To be clear: Still very much an issue. The patch above made it usable, but, for example when opening a different route while the current one is closing, there's a weird jump in the animation. Where it previously wouldn't have responded at all it now does respond, but with a weird animation jump |
That's a great observation, given the sample reproduces the issue when swiping back with |
Has any news ? |
Sorry we haven't gotten to this yet. This isn't actively being worked on yet, but it is high on my list once I finish a few other issues, unless someone else gets to it first. |
any updates? |
This issue is assigned but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks! |
I'm not currently working on this, but I'm leaving it assigned as this, and other route transition issues are immediate on my list after I finish the current larger issues on my queue. If someone wants to take a crack at it before then, feel free to submit a PR or reach out. |
This issue is assigned to @MitchellGoodwin but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks! |
I'm facing the same issue with MaterialPageRoute, if you wait a little bit it works fine but if you tap something immediately after going back it doesn't work. |
The problem is that after I use cupertionPageroute, when I swipe back to the previous page on iOS device, there is a high probability that the first time I click on the content of the previous page, nothing happens until I click twice, especially when you are halfway through the slide. Let go, and then quickly click on the previous page. The online business here is very seriously affected.
video
2020-12-285.26.13.mov
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.22.4, on macOS 11.1 20C69 darwin-x64, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (version 4.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.52.1)
[✓] Connected device (2 available)
! Doctor found issues in 2 categories.
this is the mini example
main.dart
page.dart
The text was updated successfully, but these errors were encountered: