-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
From flutter/website#9183 (comment)
Currently the API docs does not distinguish which constructor should be used in what context.
The linked comment says:
We don't recommend using fromSwatch (M1/M2 concept) but rather fromSeed (M3+)
but the docs for fromSwatch say
This constructor is used by ThemeData to create its default color scheme.
fromSeed is a bit clearer, but it isn't clear to me as a Flutter developer which I should use and how they differ in the context of M1/2 versus M3
Using the seedColor as a starting point, a set of tonal palettes are constructed. These tonal palettes are based on the Material 3 Color system and provide all the needed colors for a ColorScheme. These colors are designed to work well together and meet contrast requirements for accessibility.
While we're at it, the other constructors should be checked for the same clarity for M1/2/3:
- dark
- light
- highContrastDark
- highContrastLight
Metadata
Metadata
Assignees
Labels
Type
Projects
Status