Button theme works with RaisedButton (deprecated) but not witn ElevatedButton

When I use buttonTheme it works with RaisedButton.

buttonTheme: ButtonThemeData(
  buttonColor: Colors.green.withAlpha(125),

But since RaisedButton is deprecated it does not work with ElevatedButton. So how to use it for ElevatedButton?

>Solution :

You also have an elevatedButtonTheme property :

elevatedButtonTheme : ElevatedButtonThemeData(
  // ...

Leave a Reply