What is flutter custom ColorSwatch?

Viewed 98

I'm beginner to flutter. Can someone please explain, what is custom colorswatch in flutter. I just follow the flutter documentation. but I didn't got the idea.

This is the code sample I just referred about the custom colorswatch. I cannot understand what is going on this code snippet. Please explain about colorswatch through this code snippet. Thank you very much for any help.

enter image description here

1 Answers

ColorSwatch - Creates a color that has a small table of related colors called a swatch.

const ColorSwatch<T>(
int primary,
Map<T, Color> _swatch
)

In colorSwatch, contains two properties first one containing the primary color, and the second one _swatch contains the map list of colors that show the distinct effect in ink response.

Highlight -The highlight color of the ink response when pressed. If this property is null then the highlight color of the theme, ThemeData.highlightColor, will be used.

SplashColor - The splash color of the button's InkWell. The ink splash indicates that the button has been touched. It appears on top of the button's child and spreads in an expanding circle beginning where the touch occurred.

Source: flutter.dev

Related