正确的解决方案是使用
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(...),)



