theme

ThemeData

();

MaterialApp

theme:

theme

copyWith

colorScheme:

theme

colorScheme

copyWith

secondary:

myColor

),

),

//...

accentColor

The closest backwards compatible ColorScheme color is
ColorScheme.secondary. To hew most closely to the latest Material
Design guidelines one can substitute ColorScheme.primary instead.
If a contrasting color is needed then use ColorScheme.onSecondary.

Custom components that used to look up the theme’s accentColor, can look up
the ColorScheme.secondary instead.

Code before migration:

Color

myColor

Theme

of