Skip to content

Proposal to add an IconImage widget #126038

@animator

Description

@animator

Is there an existing issue for this?

Use case

Just like one can create ImageProviders from assets, network, and memory. There should be a way to create an image from IconData. It will save a lot of time and will be very convenient as the builtin icons can be directly used instead of downloading it as a png/jpg and adding it to the assets.

We already have a ImageIcon widget. Why not have something the other way around?

Example Use Case:

SwitchListTile requires activeThumbImage and inactiveThumbImage which need to be ImageProviders. I want to use pre-built icons that are already shipped with flutter, but unable to do so directly as there is no way to convert an icon into an image.

Proposal

An IconImage widget that provides Icons.heart (example) as an Image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: imagesLoading, displaying, rendering imagesc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions