Skip to content

Update snack_bar.dart - #181959

Closed
matasb-google wants to merge 1 commit into
flutter:mainfrom
matasb-google:patch-1
Closed

matasb-google wants to merge 1 commit into
flutter:mainfrom
matasb-google:patch-1

Conversation

@matasb-google

Copy link
Copy Markdown
Contributor

Ensure textScalling is taken into account for Sizing overflow.

Remove x 0.4 spacing on right when multiple lines used, not in spec for M3

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

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.

Ensure textScalling is taken into account for Sizing overflow.

Remove x 0.4 spacing on right when multiple lines used, not in spec for M3
@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages labels Feb 5, 2026
@Piinks

Piinks commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Hey @matasb-google! Is this a change you would like to move forward with? It will need a test. Please move it out of draft and mark it ready for review when it is. Thanks!

@matasb-google

Copy link
Copy Markdown
Contributor Author

Hey @matasb-google! Is this a change you would like to move forward with? It will need a test. Please move it out of draft and mark it ready for review when it is. Thanks!

This is actual fix for bug in snackbar, but it will affect tests which use goldens. Due to this I did not have time to roll this out (or write tests).

@Piinks

Piinks commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Is there an open issue we can refer to?

@Piinks Piinks added the Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. label Jun 24, 2026
@Piinks

Piinks commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I've marked this PR as not ready to port to flutter/packages yet.
We'll provide instructions to move this change over to material_ui/cupertino_ui once ready to receive PRs. Thank you!

@Piinks

Piinks commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This PR is now ready to port over to flutter/packages!

See instructions and guidance in #188444 Thank you!

@Piinks Piinks added Decoupling: Port to flutter/packages This PR is ready to be ported to flutter/packages. We will provide instructions to do so. and removed Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. labels Sep 2, 2026
@matasb-google

Copy link
Copy Markdown
Contributor Author

Ported over to flutter/packages: flutter/packages#12737

auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Oct 10, 2026
…tion overflow (#12737)

Port of flutter/flutter#181959 to `flutter/packages` as 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
- Ensure textScalling is taken into account for Sizing overflow: passes `MediaQuery.textScalerOf(context)` to `actionTextPainter` so that `actionAndIconWidth` properly scales with accessibility text scaling.
- Removes `SizedBox(width: snackBarWidth * 0.4)` when the action overflows, eliminating unintended blank space on the right of multi-line content.
- Adds unit tests in `snack_bar_test.dart` verifying `textScaler` overflow calculation and layout.
- Adds pending changelog entry.

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). 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.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Decoupling: Port to flutter/packages This PR is ready to be ported to flutter/packages. We will provide instructions to do so. framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants