Skip to content

Conversation

@chunhtai
Copy link
Contributor

Previously the appbar infer backbutton from navigator.canpop, and Scaffold end drawer. It is hard to maintain. The internal use case is that they also want to backbutton to show up if there is a nested navigator in the route, so we have to provide a API to add appbar on route level as well.

This pr makes it so the ModalRoute.impliesAppBarDismissal is the single source of truth to add back button. There are two ways people can add backbutton.

  1. overrides the ModalRoute.impliesAppBarDismissal directly
  2. add a localhistory entry with impliesAppBarDismissal=true.

fixes #80256

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels. labels Apr 18, 2022
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this should default to false, but i made it true for backward compatibility

@chunhtai chunhtai requested review from dnfield and goderbauer April 18, 2022 17:56
@chunhtai
Copy link
Contributor Author

This change will require a internal fix, since some of the internal test still relies on willHandlePopInternally to bring up the backbutton

@chunhtai
Copy link
Contributor Author

a friendly bump

@chunhtai chunhtai force-pushed the issues/80256-reland branch from 9776926 to dbe3b42 Compare April 28, 2022 22:49
@chunhtai chunhtai force-pushed the issues/80256-reland branch from dbe3b42 to fdd087a Compare May 4, 2022 21:37
@fluttergithubbot fluttergithubbot merged commit f8f4387 into flutter:master May 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2022
chunhtai pushed a commit that referenced this pull request May 18, 2022
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request May 18, 2022
chunhtai added a commit to chunhtai/flutter that referenced this pull request May 18, 2022
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request May 19, 2022
CaseyHillers pushed a commit that referenced this pull request May 19, 2022
* Roll engine to e6c31a91

* Revert "Fix Backbutton is not displayed when there is a endDrawer (#102093)" (#104039)

This reverts commit f8f4387.
chunhtai added a commit that referenced this pull request May 24, 2022
#104110)

* Reland "Fix Backbutton is not displayed when there is a endDrawer (#102093)"

This reverts commit a4a8e73.

* add todos
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
flutter#104110)

* Reland "Fix Backbutton is not displayed when there is a endDrawer (flutter#102093)"

This reverts commit a4a8e73.

* add todos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BackButton is not displayed when there is a endDrawer

3 participants