Skip to content

Conversation

@imzyy
Copy link
Contributor

@imzyy imzyy commented Mar 4, 2020

Description

In our application we want to display a close icon in AppBar with customized behavior.
backButton has onPressed parameter in initializer to enable override of default navigator pop behavior. closeButton should also be able to set it. This PR proposes a fix to it.

Related Issues

Fixes #51924

Tests

I added the following tests:

CloseButton onPressed overrides default pop behavior

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@fluttergithubbot fluttergithubbot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Mar 4, 2020
@imzyy
Copy link
Contributor Author

imzyy commented Mar 4, 2020

@HansMuller Could you please help review it? Thanks.

@shihaohong shihaohong changed the title closeButton should be able to set onPressed as backButton Custom onPressed behavior for CloseButton widget Mar 4, 2020
Copy link
Contributor

@shihaohong shihaohong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for improving the other test as well!

@fluttergithubbot fluttergithubbot merged commit cccbf1f into flutter:master Mar 5, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

closeButton should be able to set onPressed as backButton

4 participants