Skip to content

Split the configuration for selecting an image from the configuration of its painting #4500

Description

@Hixie

Right now, you pick the image using AssetImage or RawImageResource or whatever, and at the same time you specify its dimensions.

This makes it hard for other widgets to accept images in general from any source, but then additionally apply an opinion regarding how the image should be displayed (e.g. dimensions, fit, or repetition).

Proposal: We should instead have a single image-displaying widget, which you configure by passing an object that knows how to get the image (from a context).

e.g. instead of:

   new AssetImage(name: 'foo', width: 24.0)
   new RawImage(image: bar, width: 24.0)
   new NetworImage(src: 'http://baz', width: 24.0)

...have:

   new Image(image: AssetImage('foo'), width: 24.0)
   new Image(image: RawImage(bar), width: 24.0)
   new Image(image: NetworkImage('http://baz'), width: 24.0)

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jun 9, 2016
  2. added this to the milestone on Jun 9, 2016
  3. self-assigned this
    on Jun 9, 2016
  4. github-actions commented on Aug 15, 2021

    @github-actions

    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.

  5. locked as resolved and limited conversation to collaborators on Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions