Row(
children: [
Expanded(
child: InkWell(
onTap: () {},
child: Hero(
tag: image,
child: Container(
child: CachedNetworkImage(
imageUrl: image,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
),
placeholder: (context, url) => Container(
height: 40.h,
child: Shimmer.fromColors(
baseColor: (Get.isDarkMode
? Colors.grey[800]
: Colors.grey[300])!,
highlightColor: (Get.isDarkMode
? Colors.grey[500]!
: Colors.grey[100])!,
child: Column(
children: [
Container(
width: double.infinity,
)
],
),
),
),
errorWidget: (context, url, error) => Icon(Icons.error),
),
)),
),
),
],
)
I tried to fit using boxFit.contain but its not working. How do I create a container that responds to my image size like facebook or instagram which sizes its container according to image size