The `ThemeData.dialogBackgroundColor` parameter was deprecated in favor of the `DialogThemeData.backgroundColor` parameter.
Original behavior
The defaults for the `Dialog` and `AlertDialog` widgets can be overridden with a component-specific theme like `DialogThemeData`. Previously, the `ThemeData.dialogBackgroundColor` parameter was used to override the default dialog background color, which was made redundant by `DialogThemeData`.
New behavior
The `ThemeData.dialogBackgroundColor` is deprecated in favor of a component-specific theme. Use `DialogThemeData` to override the default background color.
- Who is affected
- Code that still calls the deprecated API; it keeps working until removal but produces analyzer warnings. Code that uses ThemeData.dialogBackgroundColor, DialogThemeData.backgroundColor, Dialog 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)
| 1 | theme: ThemeData( | |
| 2 | − | dialogBackgroundColor: Colors.orange, |
| 3 | ), |
| 1 | theme: ThemeData( | |
| 2 | + | dialogTheme: const DialogThemeData(backgroundColor: Colors.orange), |
| 3 | ), |
Raw before / after
theme: ThemeData( dialogBackgroundColor: Colors.orange, ),
theme: ThemeData( dialogTheme: const DialogThemeData(backgroundColor: Colors.orange), ),
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
Replace [ThemeData.dialogBackgroundColor][] with
[DialogThemeData.backgroundColor][] to override the
default dialog background color.
Code before migration:
theme: ThemeData(
dialogBackgroundColor: Colors.orange,
),Code after migration:
theme: ThemeData(
dialogTheme: const DialogThemeData(backgroundColor: Colors.orange),
),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; 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.
- Official migration guide
- Issue #91772
- Deprecate ThemeData.dialogBackgroundColor in favor of DialogTheme.backgroundColor
- 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.