In this screen on top I have button and a text, in second I have a list view. I want to reduce the gap between first and second layout.
This is the image in which I marked red. That red marked space I want to reduce I am calling widget's body Column like below.
Widget body = new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
toplayout,
listScreen,
startButtonlayout
],
);
First layout as below
Widget toplayout = new Container(
width: 70,
height: 70,
color: Colors.red,
child: new Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Builder(builder: (context) => IconButton(
icon: Icon(Icons.arrow_back),
iconSize: 30,
onPressed: () {
// Here i want context
if (Navigator.canPop(context)) {
Navigator.pop(context);
} else {
SystemNavigator.pop();
}
},
),),
new Container(
margin: const EdgeInsets.fromLTRB(20, 0, 0, 0),
child: new Text("Day 1",
style: new TextStyle(
fontSize: 30,
color: Colors.black,
)))
],
),
);
Widget listScreen = new Expanded(
child: new Container(
child: new ListViewExample(),
),
);
class ListViewExample extends StatefulWidget {
@override
State<StatefulWidget> createState() {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
));
SystemChrome.setEnabledSystemUIOverlays(
[SystemUiOverlay.top, SystemUiOverlay.bottom]);
// TODO: implement createState
return ExerciseListPage();
}
}
This is the list
List<GestureDetector> _buildListItemsfromFlower() {
return flowers.map((flowers) {
var flatbutton = GestureDetector(
child: Card(
elevation: 10.0,
child: new Row(
textBaseline: TextBaseline.alphabetic,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
new Container(
child: new Column(
children: <Widget>[
new Container(
width: MediaQuery.of(context).size.width * 0.5,
height: MediaQuery.of(context).size.height / 15,)))
As it is taking more gap between the widgets in column i want to reduce it. I have not mentioned any margins.