Reputation: 4111
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. •
Please help me with a proposed fix for buttonColor. Thanks.
Upvotes: 0
Views: 1514
Reputation: 1487
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.
Upvotes: 2
Reputation: 748
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.
Upvotes: 2