Home > database >  Flutter upgrade to 2.5.3 causing deprecated issue in TextStyle color
Flutter upgrade to 2.5.3 causing deprecated issue in TextStyle color

Time:03-15

'buttonColor' is deprecated and shouldn't be used. No longer used by the framework, please remove any reference to it. This feature was deprecated after v2.3.0-0.2.pre.

Below is the code causing the issue:

enter image description here

What should I change instead of buttonColor. I tried with primary but could not find any reference in the official doc.

Thaks.

CodePudding user response:

You can use TextTheme

In your material app theme

textTheme: TextTheme(
  button: TextStyle(
     fontSize: 18.0,
     color: "Your color",
     fontWeight: FontWeight.bold
)

In your code

Text(
    style: Theme.of(context).textTheme.button
)

CodePudding user response:

Yes, there has been couple of breaking changes on buttons that you can see here --> enter image description here

  • Related