I am trying to show a circular progress indicator, while I run an async task. The async task is triggered by a button click and is also directing the user to a new page. The code looks like this:
child: GestureDetector(
onTap: () async{
//some async task that takes a few seconds
Navigator.push( ...
}
I want the user, when he clicks the button to first see a circular progress indicator and when the task is complete he should be directed to another screen. But I have no idea how to show him this progress indicator. Thanks for your answers in advance!
You can use this library https://pub.dev/packages/simpleprogressdialog
ProgressDialog progressDialog = ProgressDialog(context: context, barrierDismissible: false);Then invoke
showMaterialbefore your async taskThen after the async task, dismiss the dialog.