-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: PopScope not working with modals in Flutter 3.24+ (#237)
## 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
- Loading branch information
Showing
13 changed files
with
49 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"flutter": "3.22.3" | ||
"flutter": "3.24.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ on: | |
push: | ||
branches: main | ||
pull_request: | ||
branches: main | ||
|
||
jobs: | ||
dry-publish: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"dart.flutterSdkPath": ".fvm/versions/3.22.3" | ||
"dart.flutterSdkPath": ".fvm/versions/3.24.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters