Repository navigation
Closed
flutter/packages
#12737Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Problem Description
When calculating whether a SnackBar action and icon overflow the available snackBarWidth (willOverflowAction in _SnackBarState), actionTextPainter is created without passing MediaQuery.textScalerOf(context):
final actionTextPainter = TextPainter(
text: TextSpan(
text: widget.action?.label ?? '',
style: Theme.of(context).textTheme.labelLarge,
),
maxLines: 1,
textDirection: TextDirection.ltr,
)..layout();As a result:
- When a user has accessibility / text scaling enabled, the rendered action button scales up, but
actionTextPaintercomputes the unscaled width (scale 1.0). willOverflowActionevaluates tofalsewhen it should betrue, causing action buttons to overflow or become cramped/truncated on single-line layouts instead of properly wrapping into a multi-line layout.- Additionally, in the multi-line layout, an unnecessary
SizedBox(width: snackBarWidth * 0.4)was being added to the content row, leaving 40% blank space on the right of multi-line content.
Proposal
- Pass
textScaler: MediaQuery.textScalerOf(context)toactionTextPainterin_SnackBarState. - Remove the
snackBarWidth * 0.4sized box whenwillOverflowActionis true.
Related / original PR: #181959
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Activity
mbcorona commentedon Sep 3, 2026
Hi @matasb-google , thanks for reporting this and linking a PR.
Im routing to the design team as a proposal to evaluate.
github-actions commentedon Oct 24, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.