我在ipad应用程序中出现了溢出错误,该应用程序设计得很扑朔迷离,但无法获得确切的ui。
下面是我尝试过的代码段。
return Row(
children: <Widget>[
Text(
'Rebars were ASTM grade ',
style: TextStyle(fontSize: labelSize),
),
Container(
width: 50,
height: 30,
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(),
hintText: '20',
hintStyle: TextStyle(
color: Colors.grey,
),
contentPadding: EdgeInsets.symmetric(vertical: 5, horizontal: 15),
),
),
),
Text(
' and were placed in general accordance with ACI code 318.',
style: TextStyle(fontSize: labelSize),
),
],
);
尝试用Row
包装Container
小部件,然后将Container
的宽度设置为double.infinity
或MediaQuery.of(context).size.width
。