Home > database >  Flutter upgrade to 2.5.3 causing deprecated issue
Flutter upgrade to 2.5.3 causing deprecated issue

Time:03-15

I have been been able to upgrade my code from flutter 1.2.0 to 2.5.3. Still I am getting some deprecated warnings as mentioned below:

info • '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. •

enter image description here

Please help me with a proposed fix for buttonColor. Thanks.

CodePudding user response:

Instead of buttonColor you could use ButtonTheme.

ThemeData(
    appBarTheme: appBarTheme,
    scaffoldBackgroundColor: scaffoldBackgroundColor,
    primarySwatch: primarySwatch,
    textTheme: textTheme,
    buttonTheme: ButtonThemeData(buttonColor: AppColor.appBlueColor)
)

Read more on ThemeData class.

CodePudding user response:

https://docs.flutter.dev/release/breaking-changes/buttons

Here's an detailed explanation from official docs.

If you still have doubts feel free to ask.

  • Related