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

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

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: "请输入数据"),
                            ),
                          ),


相关文章
|
6月前
|
Android开发
Can t process attribute android:fillColor=@color/camera_progress_delete: references to other resou
Can t process attribute android:fillColor=@color/camera_progress_delete: references to other resou
44 1
|
API
DataTables中的column().visible()
在数据表中显示和隐藏列非常方便,尤其是在显示信息密度较大的表时。此方法允许即时更改单个列的可见性,或读取列的可见性状态。
167 0
the content is displayed over another view controller’s content
the content is displayed over another view controller’s content
128 0
the content is displayed over another view controller’s content
|
Android开发
【Android】解决TextView.setText提示Do not concatenate text displayed with setText. Use resource string
【Android】解决TextView.setText提示Do not concatenate text displayed with setText. Use resource string =
350 0
|
C#
Styling a ListView with a Horizontal ItemsPanel and a Header
原文 http://eblog.cloudplush.com/2012/05/23/styling-a-listview-with-a-horizontal-itemspanel-and-a-header/ I had to create a specific ListView for my WPF project.
1001 0