-
Notifications
You must be signed in to change notification settings - Fork 22
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
PopScope can not work when I drag down ModalSheetRoute in Flutter 3.24 #233
Comments
Hi @Tommy-Wang0602, TL;DRThere are 2 options to work around this issue:
I'm planning to work on a solution soon... Details
As far as I know, the only solution is to replace |
@fujidaiti |
By this weekend, hopefully... |
…ersions in CI (#235) ## Related issues (optional) Closes #229. ## Description The workflow file was updated to run unit tests and static analysis for both the lowest and highest supported Flutter SDK versions. This approach helps detect potential compatibility issues across the entire supported SDK range. For example, issue #144 stemmed from accidentally using newly added APIs in Flutter 3.22 that don't exist in lower versions, while issue #233 arose due to a breaking change introduced in Flutter 3.24. ## Summary (check all that apply) - [ ] Modified / added code - [ ] Modified / added tests - [ ] Modified / added examples - [x] Modified / added others (pubspec.yaml, workflows, etc...) - [ ] Updated README - [ ] Contains breaking changes - [ ] Created / updated migration guide - [ ] Incremented version number - [ ] Updated CHANGELOG
## Description Added regression tests for #233 and pinned Flutter version to v3.22.3 for development and CI. This downgrade was necessary as tests fail with Flutter 3.24+ due to a [breaking change](https://docs.flutter.dev/release/breaking-changes/popscope-with-result), which caused that issue. The fix for #233 is not included here as it requires Flutter 3.24+, while the main branch will use v3.22.3 post-merge. To accommodate this version disparity, the fix will be implemented in a separate branch, providing distinct solutions for users of Flutter 3.24+ and 3.22.3 or earlier. ## Summary (check all that apply) - [ ] Modified / added code - [x] Modified / added tests - [ ] Modified / added examples - [x] Modified / added others (pubspec.yaml, workflows, etc...) - [ ] Updated README - [ ] Contains breaking changes - [ ] Created / updated migration guide - [ ] Incremented version number - [ ] Updated CHANGELOG
## Related issues (optional) Fixes #233. ## Description This PR migrates from `Route.onPopInvoked` to `Route.onPopInvokedWithResult` to address the issue. Here's a detailed explanation of this change (quoted from the README): > This package previously used the `Route.onPopInvoked` method to invoke > `PopScope.onPopInvoked` callbacks when users performed a > swipe-to-dismiss gesture. However, these methods were deprecated in > Flutter 3.24.0 as part of a [breaking > change](https://docs.flutter.dev/release/breaking-changes/popscope-with-result) > related to the `PopScope` widget. The problem is that > `ModalRoute.onPopInvoked`, which was an override of `Route.onPopInvoked` > and where `PopScope.onPopInvoked` callbacks were actually invoked, was > removed. As a result, the `PopScope.onPopInvoked` callback is no longer > invoked in Flutter 3.24+. These changes led to issues such as > [#233](#233). > > The only possible solution was to replace `Route.onPopInvoked` with > `Route.onPopInvokedWithResult`, which was introduced in Flutter 3.24.0. > However, migrating to the new API would require increasing the lower > bound of the SDK constraint to 3.24.0. For those using an SDK version > lower than 3.24, this change would be a significant breaking change. > Ultimately, we decided to publish different versions for different SDK > constraints to maintain backward compatibility. ## Summary (check all that apply) - [x] Modified / added code - [ ] Modified / added tests - [x] Modified / added examples - [x] Modified / added others (pubspec.yaml, workflows, etc...) - [x] Updated README - [ ] Contains breaking changes - [ ] Created / updated migration guide - [x] Incremented version number - [x] Updated CHANGELOG
@Tommy-Wang0602 Please follow to this guide: https://github.com/fujidaiti/smooth_sheets?tab=readme-ov-file#for-developers-using-flutter-324 |
hi ~ @fujidaiti
I notice tutorial imperative_modal_sheet
PopScope
can not work when I drag downModalSheetRoute
,expect will show dialog but doesn'tSDK version:
Flutter 3.24.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 80c2e84975 (4 weeks ago) • 2024-07-30 23:06:49 +0700
Engine • revision b8800d88be
Tools • Dart 3.5.0 • DevTools 2.37.2
video:
2024-08-28.4.41.32.mov
The text was updated successfully, but these errors were encountered: