How to set width of CupertinoButton in Flutter?


Am I missing something obvious here?
Setting minSize on CupertinoButton button sets width and height (see image).

How do I set only the width?

Thanks in advance.

CupertinoButton's minSize


Wrap it in a SizedBox and set width and height.


   width: 500,
   height: 200
   child: CupertinoButton(
       onPressed: (){},
       child: Text("Click Me", style: TextStyle(color: Colors.white)),

NOTE: It is best practice to use SizedBox as it is more efficient since you only need to change the width and height.

Check this.
Flutter: SizedBox Vs Container, why use one instead of the other?

Answered By – Josteve

Answer Checked By – Terry (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *