Reputation: 113
flutter AppBarTheme brightness is deprecated and recommend colorScheme what is colorScheme and how to implement it
Upvotes: 3
Views: 6331
Reputation: 3087
ColorScheme is A set of colors based on the Material color system that can be used to configure the color properties of most components.
you can use it like this
static const ColorScheme colorSchemeLight = ColorScheme(
primary: primaryColor,
secondary: accentColor,
surface: background,
background: background,
brightness: Brightness.light,
error: failurRed,
onBackground: Colors.black,
onError: Colors.white,
onPrimary: Colors.white,
onSecondary: Colors.white,
onSurface: Colors.black,
primaryContainer: primaryColor,
secondaryContainer: accentColor,
);
mainTheme = ThemeData(
appBarTheme: appBarTheme,
brightness: Brightness.light,
primaryColor: primaryColor,
colorScheme: colorSchemeLight,
textTheme: viatoTextTheme,
backgroundColor: background,
scaffoldBackgroundColor: background);
Upvotes: 6