What is the difference between ColorScheme and ColorSchemeSeed in Flutter?

322 views Asked by At

In Flutter, one can apply a theme to the app using ThemeData class. But there two propeties of this class that confuses me: ColorScheme and ColorSchemeseed. What's the difference between these two properties and when to use one or the other? Thanks.

Clear my Confusions on it.

1

There are 1 answers

0
Vivek Chib On

ColorScheme allows you to define each color property manually.

ColorScheme(
  brightness: Brightness.light,
  primary: Color(0xFF0095FF),
  onPrimary: Color(0xFFFFFFFF),
  primaryContainer: Color(0xFFD3E4FF),
  onPrimaryContainer: Color(0xFF001C38),
  secondary: Color(0xFF006495),
  onSecondary: Color(0xFFFFFFFF),
  .....
);

ColorSchemeSeed generates colorScheme based on one color.