-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
I had a use case where I wanted to style a TabBar using its TabBarTheme.
However, I noticed two issues with it:
- The
indicatorColoris only taken from theTabBarThemewhen usinguseMaterial3: true. When not using Material 3, it is using the to-be-deprecatedThemeData.indicatorColor. (I am aware that the transition touseMaterial3: trueis imminent, but the flag will persist for a while after the fact still) - The
colorof thelabelStyleis ignored. Instead thelabelColorproperty of the TabBar is used. This is mentioned in the docs, but if someone were to setTabBarThemeData.labelStyle.color, it feels weird that it does not apply.
Proposal
For the first issue, we could add a fallback to TabBarThemeData.indicatorColor regardless of the usage of Material 3.
final Color? indicatorColor = widget.indicatorColor ?? tabBarTheme.indicatorColor ?? theme.indicatorColor;
When ThemeData.indicatorColor is removed, we just remove it from here.
For the second issue, the problem is more subtle, but the solution should be straightforward.
The labelColor can be a MaterialStateColor. However, a MaterialStateColor is also a Color.
I'd propose that we deprecate the separate labelColor and that we use the labelStyle.color instead.
Related: #91772
maRci002
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Type
Projects
Status
Done (PR merged)