Skip to content

Drawer barrier non dismissible with the escape key #173263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

romanejaquez
Copy link
Contributor

@romanejaquez romanejaquez commented Aug 5, 2025

Additional fix for the 'drawerBarrierDismissible' feature in which the ESC key can close the drawer even if the flag is set to false.

Pre-launch Checklist

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

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

romanejaquez and others added 23 commits March 7, 2025 14:55
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
…missible"; moved tests topackages/flutter/test/material/drawer_test.dart
…ally_assessments; left the ones there as they were before
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Co-authored-by: Justin McCandless <justinjmccandless@gmail.com>
…losed using the escape key if the drawerBarrierDismissible flag is set
@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Aug 5, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a drawerBarrierDismissible property to Scaffold and DrawerController to control whether the drawer can be dismissed by tapping the scrim or pressing the escape key. The implementation is straightforward, passing the new property down from Scaffold to DrawerController and using it to conditionally enable dismissal gestures. The changes are well-covered by new tests. I have one suggestion to improve the efficiency and readability of the code that handles the escape key dismissal.

@dkwingsmt
Copy link
Contributor

The analyzer is complaining. There were also a lot of unnecessary formatting changes. Can you try dart format after updating all packages?

@romanejaquez romanejaquez force-pushed the drawer_barrier_non_dismissible branch from 7ff2f1b to ec35f07 Compare August 14, 2025 14:37
Copy link
Contributor

@justinmc justinmc 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 following up and fixing this.

I'm a little confused about the fact that it looks like changes from #164810 are in this PR? Was it just reverted or am I misreading it?

@justinmc
Copy link
Contributor

Also, you may need a merge or rebase in order to fix the ci.yaml validation check.

@romanejaquez romanejaquez force-pushed the drawer_barrier_non_dismissible branch from d2992f9 to 3700459 Compare August 15, 2025 00:40
@justinmc
Copy link
Contributor

Looks like the changes from #164810 are no longer showing up, thank you! But you've got an analyzer failure.

@dkwingsmt dkwingsmt self-requested a review August 20, 2025 18:41
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. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants