处理办法第一种:没有高度就用一个有高度的 View 来加载 Container,于是有了
new Container(
height: 60.0,
child: new RaisedButton(onPressed: (){},
child: new Text("测试Buton的宽度"),
color: Colors.deepOrange,
),
),
处理办法二,使用pading来实现 Button的高度
new Padding(padding: new EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
child: new Row(
children: <Widget>[
new Expanded(child:
new RaisedButton(onPressed: (){
print(" 我点击了 Padding 下的 RaisedButton");
},
//通过控制 Text 的边距来控制控件的高度
child: new Padding(padding: new EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 10.0),
child: new Text("Padding测试Buton的宽度"),
),
color: Colors.deepOrange,
),
),
],
),
),
![关于 Flutter的Button按钮没有高度设置-LMLPHP 关于 Flutter的Button按钮没有高度设置-LMLPHP]()