I call Navigator pushReplacement to show a new view within my flutter app and want to immediately pop up a simple dialog to introduce the page to the user. (I want the user
You can call the dialog from inside 'initState()' dalaying its appearance after the first frame has been drawn.
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
await showDialog(
context: context,
builder: (BuildContext context) => new AlertDialog(
title: new Text("title"),
content: new Text("Message"),
actions: [
new FlatButton(
child: new Text("OK"),
onPressed: () {
Navigator.of(context).pop();
},
),
],
),
);
});
}