Issue
The accentColor in ThemeData was deprecated.
What to use then in ThemeData?
theme: ThemeData(
brightness: Brightness.light,
primaryColor: kBaseColor,
accentColor: kBaseAccentColor, // 'accentColor' is deprecated and shouldn't be used
Solution
accentColor is now replaced by ColorScheme.secondary.
Using new
ThemeData:theme: ThemeData( colorScheme: ColorScheme.fromSwatch().copyWith( secondary: Colors.red, // Your accent color ), )Using existing
ThemeData:final theme = ThemeData.dark();You can use it as:
theme: theme.copyWith( colorScheme: theme.colorScheme.copyWith( secondary: Colors.red, ), )
Answered By - CopsOnRoad
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.