How to set the width of a RaisedButton in Flutter?

后端 未结 20 1911
傲寒
傲寒 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:33

    If you don't want to remove all the button theme set up.

    
    
    
    ButtonTheme.fromButtonThemeData(
      data: Theme.of(context).buttonTheme.copyWith(
                    minWidth: 200.0,
                    height: 100.0,,
                  )
      child: RaisedButton(
        onPressed: () {},
        child: Text("test"),
      ),
    );
    
    

提交回复
热议问题