There are several posts, like this one, describing how to add rounded corners to an images using ClipRRect. They're working for me except my images aren't constraining properly in width. E.g., my attempt at a square image below
ListView( // <- Works fine when not in ListView?
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: GestureDetector(
onTap: () => _getFromGallery(),
child: Container(
color: Colors.blue,
child: ClipRRect(
borderRadius: BorderRadius.circular(50.0), //or 15.0
child: CachedNetworkImage(
imageUrl: image,
height: 150.0,
width: 150.0,
fit: BoxFit.cover,
),
),
),
),
),
]
has the proper height but the width expands the whole device screen, like this?
EDIT
This attempt
return Container(
height: 150.0,
width: 150.0,
color: Colors.blue,
child: ClipRRect(
borderRadius: BorderRadius.circular(50.0), //or 15.0
child: CachedNetworkImage(
imageUrl: image,
height: 150.0,
width: 150.0,
fit: BoxFit.fill,
),
),
);
Created this
EDIT #2
Image with no ListView