Skip to content

WillPopScope causes back button to exit app when in dialog instead of doing nothing #8354

@marklester

Description

@marklester

I am trying to test the WillPopScope here is the example code:

showDialog(context: context,
              child: new WillPopScope(
                  onWillPop: () async => false,
                  child: new AlertDialog(
                      title: new Text("Pass!"),
                      content: new Markdown(
                          data: "You Pass"),
                      actions: [
                        new FlatButton(
                            child: new Text("Continue"),
                            onPressed: () {
                              goto(nextPage);
                            })
                      ]
                  ))
          );

The expected behavior is that I can't dismiss the dialog. Yet I can
From debugging here is the route being set in WillPopScopeState

_DialogRoute("null", animation: AnimationController(▶ 0.000; for _DialogRoute))

Metadata

Metadata

Assignees

No one assigned

    Labels

    frameworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions