KirtM9
KirtM9

Reputation: 241

border radius being overriden? Image rendering as rectangle

I am trying to render images with curved edges, however, the images are still rendering as a plain rectangle.

Am I overriding the borderradius at all? Any thoughts on how to rectify?

GridView.count(
                              shrinkWrap: true,
                              crossAxisCount: 2,
                              childAspectRatio: (50 / 80),
                              padding: const EdgeInsets.all(3.0),
                              children:
                                  List.generate(widget.imageArray.length, (index) {
                                return Container(
                                    child: Image.file(widget.imageArray[index],
                                        fit: BoxFit.fill),
                                    decoration: BoxDecoration(
                                      color: Colors.grey[800],
                                      borderRadius: BorderRadius.circular(10)

Upvotes: 0

Views: 27

Answers (1)

Mohammed Alfateh
Mohammed Alfateh

Reputation: 3514

You can use ClipRRect

      ClipRRect(
        borderRadius: BorderRadius.circular(10),
        child: Image.file(widget.imageArray[index], fit: BoxFit.fill),
      ),

Upvotes: 1

Related Questions