Reputation: 133
I want to display dynamically an image from internet in flutter according to its size
CachedNetworkImage(
fit: if (width >height) {BoxFit.fitWidth}else{BoxFit.fitHeight},
imageUrl: "url",
placeholder: (context, url) =>
CupertinoActivityIndicator(),
errorWidget: (context, url, error) =>
Icon(Icons.error),
)
I want to have width and the height of the image so I can define which fit I want to use thanks
Upvotes: 0
Views: 1962