-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
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)Metadata
Metadata
Assignees
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flightA fix is in flight