Skip to content

Conversation

@willlarche
Copy link
Contributor

Closes #3188

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.

  • This PR should also update the default disabled color for buttons (including IconButton). Currently it's initialized like this:
    disabledColor ??= isDark ? Colors.white30 : Colors.black26;

I don't believe that's correct.

  • Before committing this change we need to make sure that the resulting contrast is sufficient for a11y.
  • This PR will need a tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid that is probably overachieving. I don't think we want to start applying 0.87 to the opacity of all icons that specify a color, even though doing so is probably what's intended by the latest spec (https://material.io/design/iconography/system-icons.html#color).

There's a fine backwards compatibility line here. The appearance of an app that has specified an icon color explicitly shouldn't change; an app that's picking up the default icon color can change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@HansMuller
Copy link
Contributor

It looks like MaterialButton needs a similar change:
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/button.dart#L414

Should just be theme.disabledColor.

LIkewise for:
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/button.dart#L418

And maybe for:
https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/switch.dart#L159

@willlarche
Copy link
Contributor Author

What about

: (themeIsDark ? Colors.white30 : Colors.black38);

@HansMuller
Copy link
Contributor

The button changes look good.

This issue's description should include before and after screenshots, to make it easier for developers to see what's changing.

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't tester.widget<Text>(find.text(testText)).style work here? The test probably doesn't need to depend on the fact that the Text widget is defined in terms of RichText.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. You have to look for the RichText widget. The style on Text widgets is null when there's no theme. But it does draw. Just with private API to the RichText.

@willlarche willlarche force-pushed the fix-3188-icon-defaultColors branch from 2433b74 to 0e39147 Compare September 4, 2018 20:54
@willlarche willlarche merged commit 2ef7cd6 into flutter:master Sep 4, 2018
@willlarche willlarche deleted the fix-3188-icon-defaultColors branch September 4, 2018 23:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default icon theme isn't using the correct color

3 participants