Repository navigation
[material_ui] Fix minimum width for Material 3 primary tab indicator - #13322
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a minimum width of 24dp for the Material 3 primary tab indicator when using the default label indicator size. It updates _IndicatorPainter to accept and enforce a minimumIndicatorWidth during painting and repainting checks, and adds a corresponding widget test to verify this behavior. There are no review comments, so no additional feedback is provided.
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
|
Thanks for the contribution! You’ve checked boxes in the PR checklist above that are not reflected in this PR, so I’m assuming this is a work in progress and am marking it as a Draft. Please review the checklist, updating the PR as appropriate, and when the state of the PR as posted reflects the checklist please feel free to mark it as ready for review. |
There was a problem hiding this comment.
Code Review
This pull request introduces a minimum width of 24dp for primary tab indicators when using Material 3 with the default label indicator size. It updates the _IndicatorPainter to enforce this minimum width by centering the indicator if its calculated width is smaller than the minimum, and adds a corresponding widget test to verify this behavior. There are no review comments, so no additional feedback is provided.
|
Hi @elliette, thanks for the guidance. I’ve updated the PR title and description, added the The full |
QuncCccccc
left a comment
There was a problem hiding this comment.
LGTM. Thanks for your contribution! Instead of fixes the issue, I changed it to "part of" because the original issue is also requesting to support secondary tab theme.
1965554 to
25e3e51
Compare
QuncCccccc
left a comment
There was a problem hiding this comment.
We should update the doc accordingy.
Clarify that the 24dp minimum applies to the default Material 3 primary TabBar indicator. Note that custom indicators retain their previous sizing. Co-authored-by: Qun Cheng <[email protected]>
|
@QuncCccccc I’ve applied your suggested changelog change and resolved the conversation. Could you please take another look and approve the PR if everything else looks good? |
|
Thank you! Please wait for a second review and then we are good to go:) |
…6210) flutter/packages@63881f9...565c657 2026-11-08 [email protected] Roll Flutter from e36b370 to acade0f (1 revision) (flutter/packages#13590) 2026-11-07 [email protected] [material_ui] Fix DropdownMenu losing text cursor when re-enabled (flutter/packages#13179) 2026-11-07 [email protected] Roll Flutter from 09175cd to e36b370 (22 revisions) (flutter/packages#13586) 2026-11-07 [email protected] [material_ui] Add Material motion springs (flutter/packages#13338) 2026-11-06 [email protected] [material_ui] Paint the active RoundedRectSliderTrackShape segment on top in RTL (flutter/packages#13225) 2026-11-06 [email protected] [pigeon] Replace Experimental with Preview (flutter/packages#13579) 2026-11-06 [email protected] [material_ui] Fix minimum width for Material 3 primary tab indicator (flutter/packages#13322) 2026-11-06 [email protected] [material_ui] Dispose drag-end CurvedAnimation in modal bottom sheet (flutter/packages#13167) 2026-11-06 [email protected] [camera_web] Re: Support for camera stream on web (flutter/packages#7950) 2026-11-06 [email protected] Roll Flutter from 3623d2d to 09175cd (61 revisions) (flutter/packages#13578) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This change gives the default Material 3 primary
TabBarindicator a minimum width of 24dp, centered on the selected label, as specified by the Material 3 tabs spec. It adds a regression test for a short tab label. Custom indicators and secondary tabs retain their existing sizing behavior.part of flutter/flutter#194716
Testing
dart run script/tool/bin/flutter_plugin_tools.dart test --packages=material_ui— passed for all four targets:material_ui, its example, the accessibility assessments app, andgen_defaults.flutter test test/tabs_test.dart— passed (204 tests), including the 24dp regression test.flutter analyze lib/src/tabs.dart test/tabs_test.dart— no issues found.dart format lib/src/tabs.dart test/tabs_test.dart— completed; no formatting changes were needed.Pre-Review Checklist
[material_ui].