`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)
| 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); |
| 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);
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
In ThemeData:
- The type of the
cardThemeproperty has been changed fromCardThemetoCardThemeData. - The type of the
dialogThemeproperty has been changed from theDialogThemetoDialogThemeData. - The type of
tabBarThemeproperty has been changed fromTabBarThemetoTabBarThemeData.
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);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.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.
- Official migration guide
- Normalize ThemeData.cardTheme
- Normalize ThemeData.dialogTheme
- Normalize ThemeData.tabBarTheme
- 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_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.