ColorSheme Flutter

·

1 min read

these 10 colors are mandatory for creating a ColorSheme for Flutter ThemData.Values for each color are optional.

primary : This is the most used color in the application

onPrimary : This color is used to color the elements on top of the primary color such as text, icons, etc.

secondary : This defines a secondary color, often used for less prominent elements like filter chips, toggle buttons, or background elements that need to stand out from the primary color but not overpower it.

onSecondary : This color is used to color the elements on top of the secondary color.

error : This is the color used for error messages or alerts, like a flashing red light to indicate a problem.

onError : This is the text color that goes well on the error color, like white text on a red sign for easy reading.

background : The primary background color for your entire application. Think of this as the canvas upon which all other UI elements are placed.

onBackground : This color is used to color the elements on top of the background color.

surface : Used as the base color for elevated UI elements like cards, sheets, dialogs, etc.

onSurface : use to color the elements on top of the surface color.

src : https://medium.com/@nikhithsunil/theme-your-flutter-app-a-guide-to-themedata-and-colorscheme-d8bca920a6b5