Skip to content

Update TabBar documentation to clarify indicatorWeight behavior#184104

Merged
auto-submit[bot] merged 1 commit intoflutter:masterfrom
saurabh-mirajkar:fix-tabbar-indicator-weight
Mar 30, 2026
Merged

Update TabBar documentation to clarify indicatorWeight behavior#184104
auto-submit[bot] merged 1 commit intoflutter:masterfrom
saurabh-mirajkar:fix-tabbar-indicator-weight

Conversation

@saurabh-mirajkar
Copy link
Copy Markdown
Contributor

@saurabh-mirajkar saurabh-mirajkar commented Mar 25, 2026

Description

Updates the documentation of TabBar to clarify the behavior of indicatorWeight when a custom indicator is provided.

Previously, the documentation stated that indicatorWeight is ignored when an indicator is specified. However, indicatorWeight is still used internally to compute the preferredSize of the TabBar, which can affect layout.

This change clarifies that:

  • indicatorWeight does not affect the visual appearance of the indicator when a custom indicator is provided
  • but it may still influence the overall size of the TabBar

Related Issue

Fixes #171951

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.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Mar 25, 2026
@google-cla
Copy link
Copy Markdown

google-cla bot commented Mar 25, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for the TabBar widget in packages/flutter/lib/src/material/tabs.dart. The change clarifies that while indicatorWeight does not affect the visual appearance of the indicator when a custom indicator is provided, it may still be used to compute the TabBar's preferred size. There is no specific feedback to provide on the changes.

Comment on lines +1003 to +1007
/// then [indicatorColor] is ignored.
///
/// The [indicatorWeight] does not affect the visual appearance of
/// the indicator when a custom [indicator] is provided. However,
/// it may still be used to compute the TabBar's preferred size.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This clarification improves the accuracy of the documentation by explaining that indicatorWeight is not entirely ignored when a custom indicator is provided, as it still contributes to the TabBar's preferredSize. This helps prevent potential misunderstandings for developers using custom indicators.

@saurabh-mirajkar saurabh-mirajkar force-pushed the fix-tabbar-indicator-weight branch from 0a95c29 to 91112dd Compare March 25, 2026 15:16
Clarifies that indicatorWeight does not affect painting when a custom indicator is provided,
but may still influence the preferred size.
@saurabh-mirajkar saurabh-mirajkar force-pushed the fix-tabbar-indicator-weight branch from 91112dd to fa4a0ff Compare March 26, 2026 03:18
Copy link
Copy Markdown
Contributor

@QuncCccccc QuncCccccc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you:)!

@QuncCccccc QuncCccccc added the CICD Run CI/CD label Mar 26, 2026
@QuncCccccc QuncCccccc added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 30, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Mar 30, 2026
Merged via the queue into flutter:master with commit e4729ca Mar 30, 2026
80 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 30, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 31, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TabBar indicatorWeight is not ignored as documented

3 participants