Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean checkbox colors so they use the material 3 palette #104446

Closed
cedvdb opened this issue May 23, 2022 · 3 comments · Fixed by #111153
Closed

Clean checkbox colors so they use the material 3 palette #104446

cedvdb opened this issue May 23, 2022 · 3 comments · Fixed by #111153
Assignees
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@cedvdb
Copy link
Contributor

cedvdb commented May 23, 2022

#91605 (comment)

The checkbox is still using the M2 defaults (there isn't an updated M3 spec for it yet). Please file a separate issue for this and we will look into at least cleaning up the defaults here.

image

Even if the specs are not out yet, the defaults could be more sensible in regards to the m3 generated colors. This looks out of place currently. The contrast looks incorrect too.

@cedvdb cedvdb changed the title Clean default checkbox so they use the material 3 palette Clean checkbox colors so they use the material 3 palette May 23, 2022
@danagbemava-nc danagbemava-nc added in triage Presently being triaged by the triage team framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. c: proposal A detailed proposal for a change to Flutter and removed in triage Presently being triaged by the triage team labels May 24, 2022
@HansMuller HansMuller assigned HansMuller and unassigned HansMuller May 24, 2022
@rydmike
Copy link
Contributor

rydmike commented Jun 9, 2022

To make the old (current ones) Switch, CheckBox and Radio more M3 compatible, my approach to them is to in their component themes define their main color to be colorScheme.primary instead of secondary, in a ThemeData that has useMaterial3 set to true. Plus, as long as ThemeData.toggleableActiveColor exists you also have to set it to colorScheme.primary when useMaterial3 is true.

This because when setting useMaterial3 to true, it is also very likely that ThemeData has an M3 ColorScheme that follows its color system design. In this color design, the secondary color is a very poor color choice for the toggles. This is also reflected in the totally new M3 Switch that uses primary, primaryContainer, surfaceVariant and outline for its colors. (https://m3.material.io/components/switch/specs)

I'm guessing there might be new M3 designs coming for CheckBox and Radio too, perhaps they do not need completely new widgets like the Switch will do (big redesign anyway), but at least new color guidance that considers the M3 color system correctly.

I don't think it would be bad choice to if the old Switch, CheckBox, Radio - especially if they remain and are replaced by new M3 variants - to set their color to primary by default, when using useMaterial3 set to true. I have used this in current state of lack of other color guidance on them when using M3 color system, and it works quite well and the old switch will then large also match the color style of the new one. But sure, I'm guessing we will see proper specs for the CheckBox and Radio soon too.

@guidezpl
Copy link
Member

guidezpl commented Jul 21, 2022

Todo when the spec comes outs

  • Add support for error state
  • Add support for MaterialStateProperty

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants