Reputation: 1094
I want to remove the gap between these two columns.
How can I achieve this?
This is the code which I tried. The Expanded()
here is inside the Row()
widget.
I would like to decrease the gap between the two Columns()
. I tried wrapping both Columns inside a Container and implementing Padding on it, but it doesn't work. I tried mainAxisAlignment also.
Expanded(
child: Column(
children: <Widget>[
Container(
width: 98.0,
child: Card(
child: ListTile(
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Room 1',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
],
),
subtitle: Padding(
padding: const EdgeInsets.only(top:8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Icon(
Icons.check_box_outline_blank
),
Icon(
Icons.check_box,
)
],
),
),
),
),
),
],
),
),
Expanded(
child: Column(
children: <Widget>[
Container(
width: 98.0,
child: Card(
child: ListTile(
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Room 1',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
],
),
subtitle: Padding(
padding: const EdgeInsets.only(top:8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Icon(
Icons.check_box_outline_blank
),
Icon(
Icons.check_box,
)
],
),
),
),
),
),
],
),
)
Upvotes: 2
Views: 3349
Reputation: 1094
The issue was solved by using Flexible()
instead of Expanded()
.
Thanks to: Jay Patel
Upvotes: 2