Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Dialog not dismissing #49

Closed
tony123S opened this issue Apr 12, 2020 · 1 comment
Closed

Dialog not dismissing #49

tony123S opened this issue Apr 12, 2020 · 1 comment

Comments

@tony123S
Copy link

Why dialog not dismiss in catch block ?

Dialog able to dismiss in try, but not in catch.

 Future<List<ABC>> getData(BuildContext context) async {
    Response response;
    var list;

    var pr = ProgressLoadingDialog().showDialog(context);
    pr.show();

    try {
      response = await _service.getAll();
      var response = ABCResponse.fromJson(response.body);
      pr.dismiss();
            ....
      return list;
    } catch (e) {
      pr.dismiss();
         ...
      return list;
    }
  }

Then I replace pr.dismiss in catch to Navigator.of(context, rootNavigator: true).pop();, and it works! But when I back to previous page and want to push to this page again, I can't..

@tony123S
Copy link
Author

tony123S commented Apr 12, 2020

The latest version solved the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant