Deprecate `ThemeData.dialogBackgroundColor` in favor of `DialogThemeData.backgroundColor`
Summary
#
The ThemeData.dialogBackgroundColor
parameter was deprecated in favor of
the DialogThemeData.backgroundColor
parameter.
Context
#
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.
Description of change
#
The ThemeData.dialogBackgroundColor
is deprecated in
favor of a component-specific theme.
Use DialogThemeData
to override the default background color.
Migration guide
#
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),
),
Timeline
#
Landed in version: 3.28.0-0.1.pre
In stable release: 3.29
References
#API documentation:
Relevant issues:
Relevant PRs:
Unless stated otherwise, the documentation on this site reflects Flutter 3.35.5. Page last updated on 2025-10-28. View source or report an issue.