【发布时间】:2022-09-23 01:25:01
【问题描述】:
我想以不同的方式垂直对齐 Row 小部件中的每一列:
我想以不同的方式垂直对齐 Row 小部件中的每一列:
我在复制相同的 UI 时遇到了一些困难,但最终结果就是这样:
IntrinsicHeight(
child: Row(
children: [
Expanded(
child: Column(
children: const [
Text("text, text, text"),
],
),
),
const Expanded(
child: Text(
"text, text, text,text, text, text,text, text, text,text, text, text,text, text, text,text, text, text,text, text, text,text, text, text"),
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: const [
Text("text, text, text"),
],
),
),
],
),
),
IntrinsicHeight 为所有Row 的孩子提供相同的高度。
这是一个正在运行的示例: https://zapp.run/edit/flutter-zn00679n106?entry=lib/main.dart&file=lib/main.dart
【讨论】: