What do these properties of color scheme in Flutter mean?

Viewed 21

I am very confused to set the color scheme in my Flutter app properly. Please help me in understanding what actually these things i.e surface, background, secondary, and all others mean.

ThemeData(
    fontFamily: 'Poppins',
    primaryColor: MyColors.amberPrimary,
    colorScheme: const ColorScheme(
      primary: MyColors.amberPrimary,
      onPrimary: Colors.white,
      secondary: Colors.white,
      onSecondary: MyColors.amberPrimary,
      surface: Colors.white,
      onSurface: MyColors.titleFontColor,
      background: Colors.white,
      onBackground: MyColors.titleFontColor,
      brightness: Brightness.light,
      error: Colors.red,
      onError: Colors.white,
    ),

Please elaborate these parameters.

2 Answers

Please refer to dart's official documentation so that you can understand the latest updated use of these parameters. You can check here

Related