...
Padding(
padding: const EdgeInsets.only(top: 120.0,
left: 12.0, right: 12.0),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
"SERVICE TYPE",
style: TextStyle(fontWeight:
FontWeight.bold),
),
Text(
"LOCATION",
style: TextStyle(fontWeight:
FontWeight.bold),
),
],
),
),
Expanded(
child: Column(crossAxisAlignment:
CrossAxisAlignment.start, children: [
Text(
"SERVICE TYPE",
style: TextStyle(fontWeight:
FontWeight.bold),
),
Text(
"LOCATION",
style: TextStyle(fontWeight:
FontWeight.bold),
),
]),
),
],
),
),
...
请帮助修复这个“不正确使用 ParentDataWidget”的错误。我需要的是一行,并在每列内有许多文本小部件的 2 列旁边。这些文本小部件不应溢出。这就是我使用扩展小部件的原因。但现在我收到了这个错误。
答案 0 :(得分:0)
移除包裹 Expanded
的两个 Column
小部件
并将 crossAxisAlignment:CrossAxisAlignment.stretch
添加到您的顶部 Row widget