Skip to content

Conversation

@TahaTesser
Copy link
Member

fixes #103642

TabBar label colors using ColorScheme.onSurface for Material 3.

Bug Fix

Using bodyMedium text style for Material 3.
As when using Material 3, bodyText1 points to bodyLarge which is a bigger font, as explained here in a test
#102121 (comment)

Screenshot 2022-05-13 at 14 46 42

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels May 13, 2022
@TahaTesser TahaTesser requested a review from darrenaustin May 13, 2022 16:44
@TahaTesser TahaTesser requested a review from HansMuller May 16, 2022 13:19
Copy link
Member

@guidezpl guidezpl left a comment

Choose a reason for hiding this comment

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

These should use tokens, e.g. and md.comp.primary-navigation-tab.with-label-text.active.label-text.color md.comp.primary-navigation-tab.with-label-text.label-text.font

@TahaTesser
Copy link
Member Author

These should use tokens, e.g. and md.comp.primary-navigation-tab.with-label-text.active.label-text.color md.comp.primary-navigation-tab.with-label-text.label-text.font

Thanks! Though I don't find these tokens in https://github.com/flutter/flutter/tree/master/dev/tools/gen_defaults/data.
I'll update this when these tokens are added.

@wanchana322

This comment was marked as spam.

@TahaTesser
Copy link
Member Author

TahaTesser commented Jun 20, 2022

cc: @darrenaustin @guidezpl

We need either mentioned tokens to land this PR sooner or land this now and update this code with tokens later.
Since currently simply enabling Material 3 breaks TabBar label colors.
This makes me think this is an important fix to land.

Steps to reproduce

  1. Test code sample from https://api.flutter.dev/flutter/material/TabBar-class.html with theme: ThemeData(useMaterial3: true),

Result:
Screenshot 2022-06-20 at 15 32 04

@guidezpl
Copy link
Member

@darrenaustin Could you add the required tokens (they're available)?

@darrenaustin
Copy link
Contributor

@darrenaustin Could you add the required tokens (they're available)?

I am waiting for another token update to land. Once it has I will add this with some newer component tokens as well.

@TahaTesser
Copy link
Member Author

I am waiting for another token update to land. Once it has I will add this with some newer component tokens as well.

Since we're waiting for tokens and this will be addressed with a wider scope by adding newer components as well by Darren Austin.

I feel safe closing this small PR.

@TahaTesser TahaTesser closed this Sep 19, 2022
@TahaTesser TahaTesser deleted the fix_tab_selected_color branch September 19, 2022 10:06
@darrenaustin
Copy link
Contributor

FYI, @QuncCccccc just landed the tokens for this today in #111913.

@TahaTesser
Copy link
Member Author

FYI, @QuncCccccc just landed the tokens for this today in #111913.

Awesome! Taking a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

AppBar with a TabBar doesn't use appropriate tab label color

4 participants