按钮宽度匹配父项

按钮宽度匹配父项,第1张

按钮宽度匹配父项

正确的解决方案是使用

SizedBox.expand
窗口部件,该窗口小部件将强制其
child
匹配其父级的大小。

SizedBox.expand(  child: RaisedButton(...),)

有很多选择,它们或多或少地允许自定义:

SizedBox(  width: double.infinity,  // height: double.infinity,  child: RaisedButton(...),)

或使用

ConstrainedBox

ConstrainedBox(    constraints: const BoxConstraints(minWidth: double.infinity),    child: RaisedButton(...),)


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5020580.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-15
下一篇 2022-11-15

发表评论

登录后才能评论

评论列表(0条)

保存