dismissOnTouchOutside does not work when dismissOnBackKeyPress is false
YDA93 opened this issue ยท 6 comments
YDA93 commented
dismissOnTouchOutside does not work when dismissOnBackKeyPress is false
marcos930807 commented
@YDA93 thanks for catch this Bug. Already working on It
YDA93 commented
I am not sure if this can be done through barrierDismissible since WillPopScope will always prevent any pop from back button and touches.
I think it would work if we create a stack and nest two widgets inside it:
- Gesture detector with max width and hight sized box that respond to any touches and force a pop according to dismissOnTouchOutside.
- Dialog widget
marcos930807 commented
@YDA93 you are right it is a little bit tricky, let mo do some research, maybe i found a more nice solution. Any help will be awesome.
marcos930807 commented
@YDA93 i have found a nice trick to determine whenever the dismiss is from ModalBarrier or BackButton using this
if (StackTrace.current.toString().contains('ModalBarrier')) so fix is in Progress.
marcos930807 commented
@YDA93 check version 2.2.1, let me know if the issue is fixed.
YDA93 commented
@marcos930807 Perfect, well done!