Reputation:
How to remove space between this columns? I marked by red color space I want to remove, it should be sticky, I guess. Is it possible?
My code for trying to do this:
child: Column(
children: [
Row(
children: [
Checkbox(
checkColor: Colors.green,
activeColor: Colors.green,
value: value,
onChanged: (value) {
value = value;
}),
Text(
'One',
style: GoogleFonts.montserrat(fontSize: 18),
),
],
),
Row(
children: [
Checkbox(
checkColor: Colors.green,
activeColor: Colors.green,
value: value,
onChanged: (value) {
value = value;
}),
Text(
'two',
style: GoogleFonts.montserrat(fontSize: 18),
),
],
),
Upvotes: 0
Views: 69
Reputation: 14775
Try below code and add visualDensity
in your Checkbox
widget
visualDensity - Its define checkbox's layout
Column(
children: [
Row(
children: [
Checkbox(
visualDensity: VisualDensity(horizontal: -4, vertical: -4),
checkColor: Colors.green,
activeColor: Colors.green,
value: value,
onChanged: (value) {
value = value;
}),
Text(
'One',
),
],
),
Row(
children: [
Checkbox(
visualDensity: VisualDensity(horizontal: -4, vertical: -4),
checkColor: Colors.green,
activeColor: Colors.green,
value: value,
onChanged: (value) {
value = value;
}),
Text(
'two',
),
],
),
],
),
Upvotes: 0
Reputation: 12565
It's not Column
issue. You got the space from checkbox
. Just wrap your checkbox
with sizebox
and give them a specific height.
Row(
children: [
SizedBox(
height: 10,
child: Checkbox(
checkColor: Colors.green,
activeColor: Colors.green,
value: value,
onChanged: (value) {
value = value;
}),
),
Text(
'One',
// style: GoogleFonts.montserrat(fontSize: 18),
),
],
),
Row(
children: [
SizedBox(
height: 10,
child: Checkbox(
checkColor: Colors.green,
activeColor: Colors.green,
value: value,
onChanged: (value) {
value = value;
}),
),
Text(
'two',
// style: GoogleFonts.montserrat(fontSize: 18),
),
],
),
])
Upvotes: 1