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: v3.27.0-0.1.pre
In stable release: TBD
References
#API documentation:
Relevant issues:
Relevant PRs:
Unless stated otherwise, the documentation on this site reflects the latest stable version of Flutter. Page last updated on 2024-10-24. View source or report an issue.