marcos930807 / awesomeDialogs

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

Documentation Suggestion for dismissing dialog. #25

Closed danhadv closed 2 years ago

danhadv commented 4 years ago

I found your dialog today and overall very happy with it!

But one thing that might help others who are new to this library.

I wanted to be able to "dismiss" the dialog from a button in my body in the same way it does when you click the background.

Maybe my understanding of Root Navigator is a little lacking, but when I called dissmiss() from my button it would change the "page" I was on and NOT remove the dialog from the screen.

After digging around and "guessing" I set useRootNavigator = true and then the dissmiss() method behaved as I would expect. I'm not real clear how having a dismiss method that does not actually remove the dialog is helpful, but I think the documentation needs to be made more clear as to the meaning of useRootNavigator. Possibly true needs to be the default?

Now it is entirely possible that I'm missing something here. But in my setup it was the only way I could seem to remove the dialog?

StrangeNoob commented 4 years ago

@danhadv Do you found the solutions of the dismissing the dialog ?

danhadv commented 4 years ago

@StrangeNoob Only what I put in my original post. I didn't have a problem, I was just suggesting an update to the documentation to make the the use of useRootNavigator clearer. When I set this property to true, it functioned as I expected.

StrangeNoob commented 4 years ago

@danhadv Thanks for the idea of yours.

OutdatedGuy commented 2 years ago

@danhadv and @StrangeNoob , if you want to dismiss the dialog with a custom button/body, just call the Navigator.pop function.

It'll produce same results as clicking in the background/barrier.