Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a card's inner padding in flutter?

I have placed a bookmark icon inside a card, but am unable to remove the inner padding of the card. I would like to have the bookmark icon stick to the border of the card. How should I do it?

I have aligned the icon to "topRight", but it can't help.

like image 529
Awoo Avatar asked Aug 30 '19 17:08

Awoo


2 Answers

I just want to leave a full code removing the default margin to make it clear

Card(
  margin: EdgeInsets.zero,
  clipBehavior: Clip.antiAlias,
  shape: RoundedRectangleBorder(
    borderRadius: BorderRadius.circular(8.0),
  ),
  elevation: 4,
  child: Image.network(
    model.item.image,
    width: 20,
    height: 200,
    alignment: Alignment.center,
    fit: BoxFit.cover,
),
like image 105
Renan Nery Avatar answered Oct 05 '22 14:10

Renan Nery


Can you try setting the margin property of card to EdgeInsets.zero

like image 31
Can Avatar answered Oct 05 '22 14:10

Can