[material_ui] Ensure textScaler is taken into account for SnackBar action overflow - #12737
Open
matasb-google wants to merge 1 commit into
Open
[material_ui] Ensure textScaler is taken into account for SnackBar action overflow#12737matasb-google wants to merge 1 commit into
matasb-google wants to merge 1 commit into
Conversation
…tion overflow Port of flutter/flutter#181959 to flutter/packages as part of the Material decoupling effort (flutter/flutter#188444). - Ensure MediaQuery's textScaler is passed to actionTextPainter so that action button width calculation scales appropriately. - Remove SizedBox(width: snackBarWidth * 0.4) when action overflows, eliminating unintended blank space on the right of multi-line content. - Add unit tests verifying textScaler overflow calculation and layout. - Add pending changelog entry.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the SnackBar implementation to respect the MediaQuery's TextScaler when calculating action overflow, and removes the unnecessary 40% blank right spacing in multi-line layouts. It also adds corresponding widget tests to verify these behaviors. There are no review comments, so I have no feedback to provide.
9 tasks
Author
|
@Piinks This has now been ported over from flutter/flutter#181959 with unit tests and pending changelog following #188444. Ready for review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of flutter/flutter#181959 to
flutter/packagesas part of the Material decoupling effort (flutter/flutter#188444).Ensure textScalling is taken into account for Sizing overflow.
Fixes flutter/flutter#192232
Fixes flutter/flutter#181959
Part of flutter/flutter#188444
Description
MediaQuery.textScalerOf(context)toactionTextPainterso thatactionAndIconWidthproperly scales with accessibility text scaling.SizedBox(width: snackBarWidth * 0.4)when the action overflows, eliminating unintended blank space on the right of multi-line content.snack_bar_test.dartverifyingtextScaleroverflow calculation and layout.Pre-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