I want my image to have inkwell effect when tapped, previously I could do that with Ink.image widget and then Provide NetworkImage() as image attribute like this:
Ink.image(
fit: BoxFit.fitWidth,
image: NetworkImage(
product.imageUrl,
),
),
But now I want to use CachedNetworkImage() because it has placeholder property to show loading status of my network image but the problem is when I use cachedNetworkImage i can no longer wrap this widget with ink.image because it requires image as an attrubute not any other widget.
Ink.image
constructor requiresimage
param to be aImageProvider
, not a widget. You can useCachedNetworkImageProvider
instead ofCachedNetworkImage
like this:However with this you'll lose placeholder capacity. However you can use
CachedNetworkImageProvider
createStream method to get anImageStream
that can be listened for errors and completion, with which you can create your own custom widget that updates the UI based on this stream.