Jenish Hirpara
Jenish Hirpara

Reputation: 21

PrimarySwatch, accentColor and canvasColor

Can someone briefly explain to me where are all the three themes(Primary Swatch, accent Color and canvas Color) used in flutter? I find extensive use of these themes but am very confused which widgets use which theme?

Upvotes: 2

Views: 5819

Answers (2)

farshid
farshid

Reputation: 166

primarySwatch: is a main color of app for example it change the color of appbar

accentColor: or secondary color is The foreground color for widgets for example floatingActionButton

canvasColor: and this can change the color of scaffold widget

Upvotes: 4

Stewie Griffin
Stewie Griffin

Reputation: 5608

You first need to learn Material Design to understand them. Check this.

primarySwatch is a MaterialColor, not a color. See this.

accentColor is a secondary color. It might be used for active tab, focused input texts, checked boxes etc.

canvasColor is the default color of MaterialType.canvas Material. Here.

Upvotes: 2

Related Questions