-
-
Notifications
You must be signed in to change notification settings - Fork 134
Progress dialog is not hiding on catchError #36
Comments
show me the code |
I handle this issue with blow code Future.delayed(Duration(seconds: 3)).then((onValue) { |
pr.show(); |
Not able to close the Dialog. |
Hi, That works because basically flutter has 2 default routes. The main route which by default renders the Scaffolds and gives them control over the screen. The other is the Modal route which renders over the main route. When a main route tries to render some dialog, it passes the current context to the dialog to take control over the screen. when you dismiss the dialog, you return the context back to the main route. The thing that we've done here. |
@Bahaaib Been stuck for an hour and finally it's working for me! Thanks |
After the #41 this code worked for me (handle ProgressDialog myDialog = ProgressDialog(context, type: ProgressDialogType.Normal);
myDialog.show().then((onValue) {
myFuture().then((myResult) {
myDialog.hide();
...
}).catchError((onError) {
myDialog.hide();
...
});
}); |
Please use the following code for showing or hiding the progress dialog
|
i want to show progress dialog on before of API call .while calling API if there is any error occurred i wants to hide the dialog on CatchError function
The text was updated successfully, but these errors were encountered: