【发布时间】:2019-11-28 14:42:32
【问题描述】:
嗨,我正在努力实现这一目标
这是我的脚本
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
child: FlatButton.icon(
onPressed: null,
icon: Icon(Icons.add),
label: Text("satu")),
color: Colors.red,
),
Column(
children: <Widget>[
Container(
child: FlatButton.icon(
onPressed: null,
icon: Icon(Icons.add),
label: Text("dua")),
color: Colors.green,
),
SizedBox(
height: 10,
),
Container(
child: FlatButton.icon(
onPressed: null,
icon: Icon(Icons.add),
label: Text("tiga")),
color: Colors.yellow,
),
],
),
Column(
children: <Widget>[
Container(
child: FlatButton.icon(
onPressed: null,
icon: Icon(Icons.add),
label: Text("dua")),
color: Colors.red,
),
SizedBox(
height: 10,
),
Container(
child: FlatButton.icon(
onPressed: null,
icon: Icon(Icons.add),
label: Text("tiga")),
color: Colors.blue,
),
],
),
]),
但是,我的脚本的结果是这样的。
然后我尝试使用SizeBox.expand 到我的FlatButton.icon 但它给我一个错误
这是错误
I/flutter (5643): ══╡ 渲染库发现异常 ╞═════════════════════════════════════════════════ ════════ I/颤振 ( 5643):在 performLayout() 期间引发了以下断言: I/flutter(5643):BoxConstraints 强制无限宽度和 无限高。 I/flutter (5643):这些无效的约束是 由 RenderSemanticsAnnotations 的 layout() 函数提供 I/flutter(5643):以下函数,它可能计算了 有问题的无效约束:I/flutter (5643):
RenderConstrainedBox.performLayout (包:flutter/src/rendering/proxy_box.dart:259:13) I/flutter ( 5643):有问题的约束是:I/flutter(5643):
BoxConstraints(最大)
任何帮助将不胜感激
【问题讨论】:
标签: flutter