
(我假设您使用的是a,
Row因为
TextField将来您想将其他小部件放在旁边。)
该
Row小部件希望确定其非柔性子代的内在大小,因此它知道为柔性子代留下了多少空间。但是,
TextField没有固有宽度。它只知道如何将自身调整为其父容器的整个宽度。尝试将其包装在
Flexible或中,
Expanded以告知
Row您期望
TextField占用剩余空间:
new Row( children: <Widget>[ new Flexible( child: new TextField( decoration: const InputDecoration(helperText: "Enter App ID"), style: Theme.of(context).textTheme.body1, ), ), ], ),
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)