class _CalculatorState extends State<Calculator> {
Widget calcbutton(String btntxt, Color btncolor, Color txtcolor) {
return Container(
child: RaisedButton(
onPressed: () {
calculation(btntxt);
},
child: Text(
btntxt,
style: TextStyle(
fontSize: 35,
color: txtcolor,
),
),
shape: CircleBorder(),
Color: btncolor,
padding: EdgeInsets.all(20),
),
);
}
When changing the Raised Button to ElevatedButton, errors on shape, Color, padding immediately appear
2
Answers
To have elevated button with the
shape
,color
, andpadding
options available, useMaterialButton
. You can set elevation for various state of the button.With the new
ElevatedButton
, these settings are now in thestyle
property.In your case, this example should do it.
You can set other properties inside
Elevatedbutton.styleFrom