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

Update Dark Theme disabledColor to White38 #35136

Merged
merged 4 commits into from
Jul 10, 2019

Conversation

shihaohong
Copy link
Contributor

@shihaohong shihaohong commented Jun 26, 2019

Description

Currently, Dark Theme in Material sets disabled states to Colors.white30. However, according to the Material Design specs for dark theme, it should be White 38% instead. This PR reflects this change.

Screen Shot 2019-06-26 at 2 29 45 PM

Related Issues

Addresses #33149

Tests

I added the following tests:

  • Updated existing tests to reflect changes to White38 instead of White30

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

@shihaohong shihaohong added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jun 26, 2019
@shihaohong
Copy link
Contributor Author

I'll hold off on sending the breaking change email until I've gotten some PR feedback on this just to make sure that everything seems ok

@@ -470,7 +470,7 @@ class ButtonThemeData extends Diagnosticable {

Color _getDisabledColor(MaterialButton button) {
return getBrightness(button) == Brightness.dark
? colorScheme.onSurface.withOpacity(0.30) // default == Colors.white30
? colorScheme.onSurface.withOpacity(0.38) // default == Colors.white38
Copy link
Member

Choose a reason for hiding this comment

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

Both conditions in are now the same here, so the conditional is unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the fix, as well as updated the API docs since I missed updating those as well

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -489,7 +483,7 @@ class ButtonThemeData extends Diagnosticable {
return button.textColor;
if (button.disabledTextColor != null)
return button.disabledTextColor;
return _getDisabledColor(button);
return colorScheme.onSurface.withOpacity(0.38);
Copy link
Contributor

Choose a reason for hiding this comment

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

NICE

@shihaohong shihaohong added the c: API break Backwards-incompatible API changes label Jul 8, 2019
@shihaohong shihaohong merged commit e7ef756 into flutter:master Jul 10, 2019
@shihaohong shihaohong deleted the disabled-color-default branch July 10, 2019 15:50
johnsonmh pushed a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
* Add Colors.white38

* Update ThemeData.disabledColor and ButtonThemeData.disabledColor to Colors.white38

* Update pre-existing tests to expect Colors.white38 instead of Colors.white30

* Update API documentation to reflect these changes
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: API break Backwards-incompatible API changes 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.

4 participants