【发布时间】:2019-01-14 04:06:35
【问题描述】:
我想让我的TextField 高度与我的容器高度相同。请检查下面的代码,让我知道如何使TextField match_parent 成为我的容器。我已经检查了这个问题The equivalent of wrap_content and match_parent in flutter?,但我没有找到任何解决方案。我需要使TextField 占据容器的全高和全宽。
new Container(
height: 200.0,
decoration: new BoxDecoration(
border: new Border.all(color: Colors.black)
),
child: new SizedBox.expand(
child: new TextField(
maxLines: 2,
style: new TextStyle(
fontSize: 16.0,
// height: 2.0,
color: Colors.black
),
decoration: const InputDecoration(
hintText: "There is no data",
contentPadding: const EdgeInsets.symmetric(vertical: 40.0),
)
),
),
)
请查看下面的屏幕截图。如前所述,我需要我的TextField 以达到Container 的全部高度
【问题讨论】:
标签: dart flutter flutter-layout