'Remove space between Card
How to remove the column space between Card ?
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Sample"),
),
body: Column(
children: <Widget>[
Card(
child: Padding(
padding: EdgeInsets.all(15),
child: Text("Card 1"),
)),
Card(
child: Padding(padding: EdgeInsets.all(15), child: Text("Card 2")),
)
],
),
);
}
Output
Solution 1:[1]
The default margin in Flutter is 4.0 pixels on all sides. To change this set
margin: EdgeInsets.zero
To learn more about margins go here
Solution 2:[2]
The error is because you using. padding: EdgeInsets.all(15) in your card. You Can alloy padding only on the required sides.
In the card try adding margin:EdgeInsets.zero
Card(
margin: EdgeInsets.zero,
),
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Eli Front |
| Solution 2 | S.R Keshav |

