Skip to content
Boring Doc
BreakingHigh impactOfficial migration guidesince 3.27.0landed 3.27.0-0.0.pre

Component theme normalization

Framework · Official source

`CardTheme`, `DialogTheme` and `TabBarTheme` were refactored to conform to Flutter's conventions for component themes. `CardThemeData`, `DialogThemeData`, and `TabBarThemeData` were added to define overrides for the defaults of the component visual properties. Releases of Flutter continue to normalize component themes like these for a more consistent theming experience in the material library.

Who is affected
Applications and packages relying on the previous behaviour or signature. Code that uses CardTheme, DialogTheme, TabBarTheme and related APIs.
Practical impact
Behaviour or API differences that can break builds or change runtime behaviour.
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−6
Before
1−final CardTheme cardTheme = Theme.of(context).cardTheme;
2−final CardTheme cardTheme = CardTheme.of(context);
3  
4−final DialogTheme dialogTheme = Theme.of(context).dialogTheme;
5−final DialogTheme dialogTheme = DialogTheme.of(context);
6  
7−final TabBarTheme tabBarTheme = Theme.of(context).tabBarTheme;
8−final TabBarTheme tabBarTheme = TabBarTheme.of(context);
After
1+final CardThemeData cardTheme = Theme.of(context).cardTheme;
2+final CardThemeData cardTheme = CardTheme.of(context);
3  
4+final DialogThemeData dialogTheme = Theme.of(context).dialogTheme;
5+final DialogThemeData dialogTheme = DialogTheme.of(context);
6  
7+final TabBarThemeData tabBarTheme = Theme.of(context).tabBarTheme;
8+final TabBarThemeData tabBarTheme = TabBarTheme.of(context);
Raw before / after
final CardTheme cardTheme = Theme.of(context).cardTheme;
final CardTheme cardTheme = CardTheme.of(context);

final DialogTheme dialogTheme = Theme.of(context).dialogTheme;
final DialogTheme dialogTheme = DialogTheme.of(context);

final TabBarTheme tabBarTheme = Theme.of(context).tabBarTheme;
final TabBarTheme tabBarTheme = TabBarTheme.of(context);
final CardThemeData cardTheme = Theme.of(context).cardTheme;
final CardThemeData cardTheme = CardTheme.of(context);

final DialogThemeData dialogTheme = Theme.of(context).dialogTheme;
final DialogThemeData dialogTheme = DialogTheme.of(context);

final TabBarThemeData tabBarTheme = Theme.of(context).tabBarTheme;
final TabBarThemeData tabBarTheme = TabBarTheme.of(context);
Migration checklist0/3
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)

In ThemeData:

  • The type of the cardTheme property has been changed from CardTheme to CardThemeData.
  • The type of the dialogTheme property has been changed from the DialogTheme to DialogThemeData.
  • The type of tabBarTheme property has been changed from TabBarTheme to TabBarThemeData.

The return type of the component theme xTheme.of() methods and Theme.of().xTheme have also changed to xThemeData accordingly.

Code before migration:

final CardTheme cardTheme = Theme.of(context).cardTheme;
final CardTheme cardTheme = CardTheme.of(context);

final DialogTheme dialogTheme = Theme.of(context).dialogTheme;
final DialogTheme dialogTheme = DialogTheme.of(context);

final TabBarTheme tabBarTheme = Theme.of(context).tabBarTheme;
final TabBarTheme tabBarTheme = TabBarTheme.of(context);

Code after migration:

final CardThemeData cardTheme = Theme.of(context).cardTheme;
final CardThemeData cardTheme = CardTheme.of(context);

final DialogThemeData dialogTheme = Theme.of(context).dialogTheme;
final DialogThemeData dialogTheme = DialogTheme.of(context);

final TabBarThemeData tabBarTheme = Theme.of(context).tabBarTheme;
final TabBarThemeData tabBarTheme = TabBarTheme.of(context);
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 (95%)

Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).

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?