[material_ui] Fix MenuAnchor scrollbar safe-area padding - #12470
[material_ui] Fix MenuAnchor scrollbar safe-area padding#12470abdullahtas0 wants to merge 2 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request prevents MenuAnchor scrollbars from inheriting system safe-area padding by removing padding from the MediaQuery surrounding the Scrollbar and restoring it for the inner scroll view. A regression test and a changelog entry are also included. The feedback suggests optimizing the implementation by using mediaQuery.removePadding(...) directly on the already retrieved MediaQueryData instance, avoiding redundant MediaQuery.of(context) lookups.
Material
Scrollbaruses the surroundingMediaQuery.paddingas painter padding when no explicit padding is provided. AMenuAnchoroverlay is already positioned within the safe area, so inheriting the view padding again shortens the scrollbar track and prevents the thumb from reaching its visual end.This change removes safe-area padding only for the menu's
Scrollbar, then restores the originalMediaQueryDatabelow it so custom menu children continue to observe the same media query values as before. It also adds a regression test and a patch changelog entry.Fixes flutter/flutter#188155.
This supersedes flutter/flutter#191085, which cannot land in
flutter/flutterbecause Material framework changes have moved tomaterial_ui.Validation:
flutter test test/menu_anchor_test.dart(171 passed, 1 skipped)flutter analyze --no-pubflutter_plugin_tools format --packages=material_uiflutter_plugin_tools validate --packages=material_ui --check-for-missing-changesPre-Review Checklist
[shared_preferences]///).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-assistbot 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.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2