marcos930807 / awesomeDialogs

A new Flutter package project for simple a awesome dialogs
Other
340 stars 110 forks source link

dismissOnTouchOutside does not work when dismissOnBackKeyPress is false #103

Closed YDA93 closed 2 years ago

marcos930807 commented 2 years ago

@YDA93 thanks for catch this Bug. Already working on It

YDA93 commented 2 years ago

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:

  1. Gesture detector with max width and hight sized box that respond to any touches and force a pop according to dismissOnTouchOutside.
  2. Dialog widget
marcos930807 commented 2 years ago

@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 2 years ago

@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 2 years ago

@YDA93 check version 2.2.1, let me know if the issue is fixed.

YDA93 commented 2 years ago

@marcos930807 Perfect, well done!