modal_bottom_sheet
modal_bottom_sheet copied to clipboard
Unwanted onWillPop calls on newest 2.0.1 version
Let's imagine our showCupertinoModalBottomSheet looks something like this:
CupertinoScaffold.showCupertinoModalBottomSheet(
expand: true,
context: context,
backgroundColor: Colors.transparent,
builder: (context) => WillPopScope(
onWillPop: onWillPop,
child: YourContent(),
),
);
Problem:
onWillPop from WillPopScope is called even if there was no actual pop from the modal.
Potential reason:
Probably removing the check if (widget.shouldClose != null && hasReachedWillPopThreshold) in this PR here is the reason of such behavior.
Please let me know if I could help by providing more info.
Any news?
Same here, when drag the modal down but drag up immediate instead of dismiss it
@ziqq unfortunately no. Looks like in every other issues there is no response yet 😢
Hey everyone, I opened a PR with a fix: https://github.com/jamesblasco/modal_bottom_sheet/pull/244.
Until it will be (hopefully 🤞) merged, you can use my fork: https://github.com/marcsanny/modal_bottom_sheet.git
- this version as the original 2.0.1 is compatible with Flutter 3.0.
This should be fixed with the latest changes. Please let me know if is no the case
This should be fixed with the latest changes. Please let me know if is no the case
Yes, confirming that it's fixed , thanks :)
@jamesblasco yes i confirmed, it's work fine.