Jordano
Jordano

Reputation: 77

How can I remove spaces between Cards in ListView?

I'm working on flutter, and i wanna illustrate some Cards in the ListView, and i succeed.

then i wanna get rid of the horizontal spaces between Cards, I searched and found few solutions, but none of them worked.

How can I remove the spaces?

ListTile(
            title:Text("   Board list"),
            tileColor: Color(COLOR_PRIMARY2),
          ),
          for(Board myBoard in boardDataList)
            BoardSelector(myBoard.boardId), //a class draws card
          ],

Thank you.

enter image description here

Upvotes: 1

Views: 1448

Answers (3)

Ravindra S. Patil
Ravindra S. Patil

Reputation: 14835

I think you set margin: EdgeInsets.zero, you refer EdgeInsets Class for official documentation here and EdgeInsets.zero here hope its help to you

      Card(
          margin: EdgeInsets.zero,
          child://Your Widget
        ),

Upvotes: 2

Jordano
Jordano

Reputation: 77

I solved this problem by modifying my code like below :

 return Card( 
      margin : EdgeInsets.all(1.0),
      child:
      ListTile(

Thank you.

Upvotes: 1

Mehdi Aboussabr
Mehdi Aboussabr

Reputation: 36

I think there's an issue with your card class, try to remove any padding property by adding EdgeInsets.zero

Upvotes: 1

Related Questions