原因
Row/Column
が幅(高さ)無限の子ウィジェットを持つときなど、このエラーが起きます。
Row(
children: <Widget>[
Container(
width: double.infinity,
),
],
);
対処法
mainAxis
(Row
ならwidth)方向でエラーが出ている場合、問題が起きている子ウィジェットをExpanded
で囲みます。
Row(
children: <Widget>[
Expanded(
child: Container(
width: double.infinity,
),
),
],
);
参考
Flutter Deep Dive Part 1: “RenderFlex children have non-zero flex…