`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.
- 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 ThemeData theme = ThemeData( | |
| 2 | − | cardTheme: CardTheme(), |
| 3 | − | dialogTheme: DialogTheme(), |
| 4 | − | tabBarTheme: TabBarTheme(), |
| 5 | ); |
| 1 | final ThemeData theme = ThemeData( | |
| 2 | + | cardTheme: CardThemeData(), |
| 3 | + | dialogTheme: DialogThemeData(), |
| 4 | + | tabBarTheme: TabBarThemeData(), |
| 5 | ); |
Raw before / after
final ThemeData theme = ThemeData(
cardTheme: CardTheme(),
dialogTheme: DialogTheme(),
tabBarTheme: TabBarTheme(),
);final ThemeData theme = ThemeData(
cardTheme: CardThemeData(),
dialogTheme: DialogThemeData(),
tabBarTheme: TabBarThemeData(),
);Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
Previously, the type of ThemeData.cardTheme was Object? to accept both
CardTheme and CardThemeData. Now that the type has been changed to
CardThemeData?, a migration is required if ThemeData.cardTheme is used.
Similarly, the types of ThemeData.dialogTheme and ThemeData.tabBarTheme
should be migrated to DialogThemeData and TabBarThemeData, respectively.
Code before migration:
final ThemeData theme = ThemeData(
cardTheme: CardTheme(),
dialogTheme: DialogTheme(),
tabBarTheme: TabBarTheme(),
);Code after migration:
final ThemeData theme = ThemeData(
cardTheme: CardThemeData(),
dialogTheme: DialogThemeData(),
tabBarTheme: TabBarThemeData(),
);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.
- 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.