Categories
Flutter Mobile Development

How to resize RaisedButton

How to resize a raised button in flutter

This is the first post in a series of short posts in which i share what i learnt in flutter.
Today i learnt that there is no easy way to resize a RaisedButton
one simple trick is to wrap the RaisedButton inside a SizedBox

SizedBox(
    height: 60.0,
    width: 150.0,
    child: RaisedButton(
      elevation: 10.0,
      color: Theme.of(context).primaryColorDark,
      textColor: Theme.of(context).primaryColorLight,
      child: Text('Save'),
      onPressed: () {
        //do stuff  
      },
    ),
  ),

Sign up to be notified of new posts. I promise i won’t spam you.

Leave a Reply

Your email address will not be published.