I want to close a specified dialog.
My case:
- Open 2 dialogs (1) and (2), and 2 dialogs are showing at the same time. (2) is overriding (1) and I want to close (1) first.
With Android: I can assign each dialog to a variable and use dialog.dismiss().
I came across this example, it works but it doesn't seem to be the best way. How to close a specific Flutter AlertDialog?
Thanks for all the answers!
As far as I know, you can't do that with Dialog because Dialog use Navigator, which use Stack only allow you to push and pop the top Route
Another option you can use to implement this is
OverLayEntry, like this: