Repository navigation
[material_ui] Fix minimum width for Material 3 primary tab indicator - #13322
hamza-flutterdev wants to merge 7 commits into
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 |
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.Fixes 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].