I want to show alert dialog based on a condition. Not based on user interaction such as button press event.
If a flag is set in app state data alert dialog is shown
Simply override initState and call your _showDialog method inside Timer.run()
initState
_showDialog
Timer.run()
@override void initState() { super.initState(); Timer.run(() => _showDialog()); }