TextField inside of Row causes layout exception: Unable to calculate size

后端 未结 8 1648
后悔当初
后悔当初 2020-11-28 04:08

I’m getting a rendering exception that I don’t understand how to fix. I’m attempting to create a column that has 3 rows.

Row [Image]

Row [TextField ]

<
8条回答
  •  日久生厌
    2020-11-28 04:52

    A simple solution is to wrap your Text() inside a Container(). So, your code will be like:

    Container(
          child: TextField()
    )
    

    Here you also get the width and height attribute of a container to adjust the look and feel of your text field. No need to use Flexible if you are wrapping your text field inside of a Container.

提交回复
热议问题