Use named Image constructors (#5129)

Some folks didn't realize these existed and asked us to add them. By
using them in examples, hopefully folks will discover them more easily.
This commit is contained in:
Adam Barth
2016-07-29 08:27:28 -07:00
committed by GitHub
parent 408e4240d0
commit 534097ffb6
13 changed files with 40 additions and 42 deletions

View File

@@ -429,7 +429,7 @@ class CardCollectionState extends State<CardCollection> {
if (_sunshine) {
cardCollection = new Stack(
children: <Widget>[
new Column(children: <Widget>[new Image(image: new NetworkImage(_sunshineURL))]),
new Column(children: <Widget>[new Image.fromNetwork(src: _sunshineURL)]),
new ShaderMask(child: cardCollection, shaderCallback: _createShader)
]
);

View File

@@ -157,8 +157,8 @@ class WeatherButton extends StatelessWidget {
child: new InkWell(
onTap: onPressed,
child: new Center(
child: new Image(
image: new AssetImage(icon),
child: new Image.fromAssetBundle(
name: icon,
width: _kWeatherIconSize,
height: _kWeatherIconSize
)