Specific min and max size for expanded widgets in Column

后端 未结 3 1010
闹比i
闹比i 2021-01-11 22:21

I have a Column with a set of Expanded widgets.

Is there a way to control the range in which they expand? I want one widget to expand only to a certain size and make

3条回答
  •  Happy的楠姐
    2021-01-11 22:58

    You can use constraint box to use the range of min and max width like below:

    Row(
          children: [
            Text("Text 1"),
            ConstrainedBox(
              constraints: BoxConstraints(maxHeight: 30, maxWidth: 40, minWidth: 30),
            ),
            Text("Text 2")
          ],
        )
    

提交回复
热议问题