How to set the width of a RaisedButton in Flutter?

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

    My preferred way to make Raise button with match parent is that wrap it with Container. below is sample code.

    Container(
              width: double.infinity,
              child: RaisedButton(
                     onPressed: () {},
                     color: Colors.deepPurpleAccent[100],
                     child: Text(
                            "Continue",
                            style: TextStyle(color: Colors.white),
                          ),
                        ),
                      )
    

提交回复
热议问题