关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

An InputDecorator, which is typically created by a TextField, cannot have an unbounded width

发布时间:2023-06-26 17:00:38

Flutter运行时报如下错误

An InputDecorator, which is typically created by a TextField, cannot have an unbounded width.

原因

TextField 没有被限定大小。

解决方法

使用Container包起来,如果时column或者row可以用Expanded包起来。

 content: Container(  width: 200,  child: TextField(  controller: _textEditingController,  decoration: const InputDecoration(hintText: "请输入数据"),  ),  ),

   



/template/Home/leiyu/PC/Static