Skip to content
Boring Doc
DeprecatedMedium impactOfficial migration guidesince 2.5.0landed 2.3.0-0.1.pre

ThemeData's accent properties have been deprecated

Framework · Official source

The ThemeData accentColor, accentColorBrightness, accentIconTheme and accentTextTheme properties have been deprecated.

Original behavior

This was a small part of the Material Theme System Updates project.

New behavior

The ThemeData accentColor, accentColorBrightness, accentIconTheme and accentTextTheme properties have been deprecated because the Material library no longer uses them.

Who is affected
Code that still calls the deprecated API; it keeps working until removal but produces analyzer warnings. Code that uses ColorScheme, FloatingActionButtonThemeData, CheckBoxTheme and related APIs.
Practical impact
Warnings now; removal in a future release. Plan the migration but no immediate break.
What action should I take?
Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.

Before and after (from the official guide)

dart+6−3
Before
 
1 MaterialApp(
2− theme: ThemeData(accentColor: myColor),
3− // ...
4−);
 
 
After
1+final ThemeData theme = ThemeData();
2 MaterialApp(
3+ theme: theme.copyWith(
4+ colorScheme: theme.colorScheme.copyWith(secondary: myColor),
5+ ),
6+ //...
7+)
Raw before / after
MaterialApp(
  theme: ThemeData(accentColor: myColor),
  // ...
);
final ThemeData theme = ThemeData();
MaterialApp(
  theme: theme.copyWith(
    colorScheme: theme.colorScheme.copyWith(secondary: myColor),
  ),
  //...
)
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)

Application theme

[ThemeData][] values no longer need to specify accentColor, accentColorBrightness, accentIconTheme, or accentTextTheme.

To configure the appearance of the material components in about the same way as before, specify the color scheme's secondary color instead of accentColor.

Code before migration:

MaterialApp(
  theme: ThemeData(accentColor: myColor),
  // ...
);

Code after migration:

final ThemeData 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(context).accentColor;

Code after migration:

Color myColor = Theme.of(context).colorScheme.secondary;

accentColorBrightness

The static [ThemeData.estimateBrightnessForColor()][] method can be used to compute the brightness of any color.

accentTextTheme

This was white [TextStyle]s for dark themes, black TextStyles for light themes. In most cases textTheme can be used instead. A common idiom was to refer to one TextStyle from accentTextTheme, since the text style's color was guaranteed to contrast well with the accent color (now ColorScheme.secondaryColor). To get the same result now, specify the text style's color as ColorScheme.onSecondary:

Code before migration:

TextStyle style = Theme.of(context).accentTextTheme.headline1;

Code after migration:

final ThemeData theme = Theme.of(context);
TextStyle style = theme.textTheme.headline1.copyWith(
  color: theme.colorScheme.onSecondary,
)

accentIconTheme

This property had only been used to configure the color of icons within a [FloatingActionButton][]. It's now possible to configure the icon color directly or with the [FloatingActionButtonThemeData][]. See [FloatingActionButton and ThemeData's accent properties][].

Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Official migration guide·Verified classification (90%)

Listed in the official breaking-changes index; title states deprecation.

An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.

Source commit
b3045439b7c0
Source last updated
Oct 21, 2026
Last synchronized
Oct 21, 2026
Publication status
published
Publication history
  • Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Was this useful?