How to dismiss flutter dialog?
I am new to flutter, I want to dismiss my dialog after the task completion. I've tried with:
But my screen is getting black and dialog is still up there. here is my dialog code.
Dialog _dialog = new Dialog( child: new Row( mainAxisSize: MainAsixSize.min, children: <Widget> [ new CircularProgressIndicator(), new Text("Loading")]), );
The dialog route created by this method is pushed to the root navigator. If the application has multiple Navigator objects, it may be necessary to call
Navigator.of(context, rootNavigator: true).pop(result)to close the dialog rather just
so I'd assume one of these two should do what you want.