如何在Flutter中设置RaisedButton的宽度? [英] How to set the width of a RaisedButton in Flutter?
本文介绍了如何在Flutter中设置RaisedButton的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经看到我无法在Flutter中设置RaisedButton
的宽度.如果我很了解,我应该将RaisedButton
放入SizedBox
中.然后,我将能够设置盒子的宽度或高度.这是正确的吗?还有另一种方法吗?
I have seen that I can't set the width of a RaisedButton
in Flutter. If I have well understood, I should put the RaisedButton
into a SizedBox
. I will then be able to set the width or height of the box. Is it correct? Is there another way to do it?
在每个按钮周围创建一个SizedBox
有点繁琐,所以我想知道为什么他们选择了这种方式.我很确定他们有这样做的充分理由,但我没有看到.
脚手架对于初学者来说很难阅读和构建.
This is a bit tedious to create a SizedBox
around every buttons so I'm wondering why they have chosen to do it this way. I'm pretty sure that they have a good reason to do so but I don't see it.
The scaffolding is pretty difficult to read and to build for a beginner.
new SizedBox(
width: 200.0,
height: 100.0,
child: new RaisedButton(
child: new Text('Blabla blablablablablablabla bla bla bla'),
onPressed: _onButtonPressed,
),
),
推荐答案
查看全文