This is how the columns are aligned.
这就是列的对齐方式。
The weight textfield needs to move up to align with the green column. It should maintain the same width.
权重文本字段需要向上移动以与绿色列对齐。它应该保持相同的宽度。
Flutter code:
颤振代码:
Row(
children: [
Expanded(
flex: 1,
child: Container(
color: Colors.indigo,
height: 50,
child: const TextField(
decoration: InputDecoration(
labelText: 'Weight',
border: OutlineInputBorder(),
),
),
)),
Expanded(
flex: 3, child: Container(color: Colors.teal, height: 100)),
Expanded(
child: Container(
height: 100,
child: Column(
children: [
Row(children: [
Text("test1", style: TextStyle(fontSize: 25)),
Text("test1")
]),
Row(children: [Text("test2"), Text("test2")])
],
),
),
),
],
),
更多回答
优秀答案推荐
You need to use this parameter (Row):
您需要使用此参数(行):
crossAxisAlignment: CrossAxisAlignment.start,
In the top-level Row Widget, add crossAxisAlignment.start
在顶级Row Widget中,添加cross AxisAlignment.start
更多回答
我是一名优秀的程序员,十分优秀!