flutter raisedbutton width code example

Example 1: flutter raisedbutton example

RaisedButton(child: Text("Rock & Roll"),
                onPressed: _changeText,
                color: Colors.red,
                textColor: Colors.yellow,
                padding: EdgeInsets.fromLTRB(10, 10, 10, 10),
                splashColor: Colors.grey,
              )

Example 2: RaisedButton hright

ButtonTheme(
  minWidth: 200.0,
  height: 100.0,
  child: RaisedButton(
    onPressed: () {},
    child: Text("test"),
  ),
);

Example 3: raisedbutton full width flutter

FractionallySizedBox(
   widthFactor: 1, // means 100%, you can change this to 0.8 (80%)
     child: RaisedButton.icon(
     onPressed: () {
     	print(comment);
     },
     label: Text('Edit Comment', style: TextStyle(color: Colors.white)),
     icon: Icon(Icons.check, color: Colors.white),
     ),
 ),

Tags:

Misc Example