gpt4 book ai didi

flutter - BoxConstraints 强制无限宽度

转载 作者:IT老高 更新时间:2023-10-28 12:32:07 28 4
gpt4 key购买 nike

在列中添加行时出现错误。我收到以下错误:

I/flutter ( 6449): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter ( 6449): The following assertion was thrown during performLayout():
I/flutter ( 6449): BoxConstraints forces an infinite width.
I/flutter ( 6449): These invalid constraints were provided to RenderAnimatedOpacity's layout() function

我的代码也供引用:

return new Scaffold(
backgroundColor: whiteColor,
body: new Column(
children: <Widget>[
imgHeader,
lblSignUp,
txtEmail,
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
txtFirstName,
txtLastName
],
),
],
),
);

最佳答案

如果您在 Row 中使用 TextField,那么您需要使用 FlexibleExpanded

此答案中提供了更多详细信息。

https://stackoverflow.com/a/45990477/4652688

关于flutter - BoxConstraints 强制无限宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52442724/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com