如何减少颤动中的小部件之间的空间

问题描述

嗨,我已经设计了一个屏幕。在上方,我有一个按钮和一个文本,在第二处,我有一个列表视图。 我想缩小第一种和第二种布局之间的差距。

This is the image in which I marked red. That red marked space I want to reduce 我正在按如下方式调用小部件的主体列。

 Widget body = new Column(
      crossAxisAlignment: CrossAxisAlignment.stretch,mainAxisSize: MainAxisSize.min,children: <Widget>[
        toplayout,listScreen,startButtonlayout
      ],);

第一种布局如下

 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),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();
      }
    
    }

这是列表

  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,)))

由于列中的小部件之间的间隙越来越大,我想减少它。我没有提到任何空白。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)