I'm creating an Custom Alert Dialog that should be dismissible when the user taps the barrier.
Both "Non Dismissable" = True and False allow the dialog to be dismissed, but I couldn't determine the circunstances. Also, it is dismissable only in the region next to the container (AlertDialog). Otherwhise it won't dismiss :(
I'm running it on preview mode
I did find the fix before posting, but will proceed to post it because I want to discuss the problem.
The problem
AlertDialog was always dismissable, but only in a small region the tap of the user on the barrier would dismiss it.
The context
This is the widget tree of the problematic AlertDialog Component:
When the top Container was marked to align to center, as bellow, the Dialog dismissable behaviour was very weird:
The solution
Use the top container without alignment:
I was capable of replicating the unexpected behavior of dismiss 3 times, so there is indeed a problem.