updateDetails() async{
showDialog(
context: context,
builder: (BuildContext ctxt) {
return Container(
child: AlertDialog(
content: Row(
children: [
Container(
child: Text("Updating profile..."),
),
CircularProgressIndicator(),
],
),
),
);
});
await updateDetails();
//NOW I HAVE TO CLOSE THIS DIALOG
}
0
votes
1 Answers
0
votes
When your loading of data is complete you have to call following code:
Navigator.pop(context);
Note: You should add return
in front of showDialog for await to work.
Edit: If you are calling showDialog inside button press event, you can try following code:
showDialog();
await updateDetails();
Navigator.pop(context);
This will pop your dialog once update is complete.
updateDetails
method? - John JoeonPressed
code . - John Joe