How to set the width of a RaisedButton in Flutter?

后端 未结 20 2417
傲寒
傲寒 2021-01-30 06:01

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

20条回答
  •  清歌不尽
    2021-01-30 06:45

    i would recommend using a MaterialButton, than you can do it like this:

    new MaterialButton( 
     height: 40.0, 
     minWidth: 70.0, 
     color: Theme.of(context).primaryColor, 
     textColor: Colors.white, 
     child: new Text("push"), 
     onPressed: () => {}, 
     splashColor: Colors.redAccent,
    )
    

提交回复
热议问题