How do I detect if a native dialog is opened?

Viewed 27

Is there a way to detect if a native dialog is opened in Flutter Framework?

Example of a native dialog below:

I would like to detect if a native dialog is opened because I use paused and inactive AppLifeCycle state to change the screen behavior. However, when the native dialog is opened the AppLifeCycle is set to inactive.

1 Answers

Because it's native you can't really tell what's in front of your app when it moves to the inactive state, but you could use the visibility_detector package to detect if and where a widget is obscured by something.

Related