modal_bottom_sheet icon indicating copy to clipboard operation
modal_bottom_sheet copied to clipboard

Unwanted onWillPop calls on newest 2.0.1 version

Open marcsanny opened this issue 2 years ago • 4 comments

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.

marcsanny avatar Mar 22 '22 14:03 marcsanny

Any news?

ziqq avatar May 06 '22 07:05 ziqq

Same here, when drag the modal down but drag up immediate instead of dismiss it

ChiPhanTlm avatar May 09 '22 13:05 ChiPhanTlm

@ziqq unfortunately no. Looks like in every other issues there is no response yet 😢

marcsanny avatar May 12 '22 13:05 marcsanny

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.

marcsanny avatar May 20 '22 08:05 marcsanny

This should be fixed with the latest changes. Please let me know if is no the case

jamesblasco avatar Sep 05 '22 10:09 jamesblasco

This should be fixed with the latest changes. Please let me know if is no the case

Yes, confirming that it's fixed , thanks :)

marcsanny avatar Sep 05 '22 11:09 marcsanny

@jamesblasco yes i confirmed, it's work fine.

ziqq avatar Sep 06 '22 06:09 ziqq