Make buttons in a row have the same width in flutter Make buttons in a row have the same width in flutter dart dart

Make buttons in a row have the same width in flutter


You can use a Row wrapping your children with Expanded:

Row(  children: <Widget>[    Expanded(      child: RaisedButton(        child: Text('Approve'),        onPressed: () => null,      ),    ),    Expanded(      child: RaisedButton(        child: Text('Reject'),        onPressed: () => null,      ),    ),    Expanded(      child: RaisedButton(        child: Text('Need Revise'),        onPressed: () => null,      ),    )  ],);


There are two ways:

  1. Expanded widget it will divide space in equal parts. If you useall expanded widget for row of column.
  2. Get the width of the screen and divide it into the required sizes equally.

Double width = MediaQuery.of(context).size.width;