Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 颤振成排_Flutter_Flutter Layout - Fatal编程技术网

Flutter 颤振成排

Flutter 颤振成排,flutter,flutter-layout,Flutter,Flutter Layout,我需要创建以下内容: 我可以使用以下代码: Row( children: <Widget>[ Container( width: 30 ), Column( children: <Widget>[ Text("label"), Container( width: screenSize.width - 30, // <- this is problem

我需要创建以下内容:

我可以使用以下代码:

Row(
  children: <Widget>[
    Container(
      width: 30
    ),
    Column(
      children: <Widget>[
        Text("label"),
        Container(
          width: screenSize.width - 30, // <- this is problem
          child: Row(
            children: <Widget>[
              Expanded( child: TextField() ),
              Expanded( child: TextField() ),
            ],
          ),
        ),
      ],
    ),
  ],
);
行(
儿童:[
容器(
宽度:30
),
纵队(
儿童:[
文本(“标签”),
容器(
宽度:screenSize.width-30,//解决方案
行(
儿童:[
容器(
颜色:颜色,红色,
宽度:50,
),
扩大(
子:列(
儿童:[
文本(“标签”),
扩大(
孩子:排(
儿童:[
扩大(
子项:TextField()
),
扩大(
子项:TextField()
),
],
),
),
],
),
),
],
);
解释 它是关于您放置
扩展的
实例的位置。
您有一行,如果它包含一个
展开的
子行,则可以填充其父行。因此,我们定义了它的一个子行(
容器
)的大小,而另一个子行仅为
展开的
。这同样适用于
子行

也许从一个简单的例子开始更容易理解。请参阅

输出


另外,欢迎使用StackOverFlow,Dmitry!

您可以在列小部件中使用crossAxisAlignment,并使其拉伸以获得屏幕中所有剩余的宽度

Row(
children: <Widget>[
Container(
  width: 30
),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch, // <- Add this
  children: <Widget>[
    Text("label"),
    Container(
      child: Row(
        children: <Widget>[
          Expanded( child: TextField() ),
          Expanded( child: TextField() ),
        ],
      ),
    ),
  ],
),],);
行(
儿童:[
容器(
宽度:30
),
纵队(
crossAxisAlignment:crossAxisAlignment.stretch//