Skip to content

Conversation

@NikoYuwono
Copy link
Contributor

Fix #11593

Add a flag to give user a way to opt-out colorization in ImageIcon.
Defaults to true to match current behaviour.
Change the opacity handling with Opacity widget to able to handle opacity when shouldRecolor is false.

@HansMuller
Copy link
Contributor

HansMuller commented Sep 27, 2018

Unfortunately, the same issue exists with ImageIcon's width, height, and opacity parameters. I don't think we'd want to gradually introduce overrides for them, since ImageIcon really doesn't do very much.

It might be simpler to just use Image directly, if the ImageIcon class is getting in the way.

    Semantics(
      label: mySemanticLabel,
      child: Image(
        image: myImage,
        width: myIconSize,
        height: myIconSize,
        fit: BoxFit.scaleDown,
        alignment: Alignment.center,
        excludeFromSemantics: true,
      ),
    );

Copy link
Contributor

Choose a reason for hiding this comment

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

This name isn't immediately clear (should recolor what? to what?).

How about honorIconThemeColor or ignoreIconThemeColor or some such?

Copy link
Contributor

Choose a reason for hiding this comment

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

we definitely shouldn't use an Opacity to change the opacity of an image. See the docs for Opacity for an alternative way to do it.

Copy link
Contributor

Choose a reason for hiding this comment

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

i think the previous state of this test represents what we actually want the behaviour to be for optimal performance

Copy link
Contributor

Choose a reason for hiding this comment

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

i think this test title may be backwards? it doesn't seem to match the test

@Hixie
Copy link
Contributor

Hixie commented Sep 28, 2018

This is great, thanks for your contribution!

@NikoYuwono NikoYuwono force-pushed the image-icon-color-flag branch from 1f5eccb to d066a1a Compare October 9, 2018 03:25
@Hixie
Copy link
Contributor

Hixie commented Nov 14, 2018

@NikoYuwono Are you interested in continuing to work on this?

@zoechi zoechi added the framework flutter/packages/flutter repository. See also f: labels. label Nov 28, 2018
@goderbauer
Copy link
Member

@NikoYuwono Are you still planning to come back to this?

@goderbauer
Copy link
Member

Closing this for now as the PR has been open for over a month without action. The issue this is fixing is tracked in #11593.

@goderbauer goderbauer closed this Jan 17, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Colors of Image Icon

6 participants