Flutter将行排成行

问题描述 投票:0回答:2

我需要创建以下内容:

“

我可以用代码来做:

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

是否有可能以其他方式执行,即width: screenSize.width - 30行?

flutter flutter-layout
2个回答
0
投票

解决方案


0
投票

您可以在Column小部件内使用crossAxisAlignment并将其拉伸以获取屏幕上所有剩余的宽度

© www.soinside.com 2019 - 2024. All rights reserved.