mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This PR is to make preparations to make `DialogTheme` conform to Flutter's conventions for component themes: * Added a `DialogThemeData` class which defines overrides for the defaults for `Dialog` properties. * Added 2 `DialogTheme` constructor parameters: `DialogThemeData? data` and `Widget? child`. This is now the preferred way to configure a `DialogTheme`: ``` DialogTheme( data: DialogThemeData(color: xxx, elevation: xxx, ...), child: Dialog(...) ) ``` These two properties are made nullable to not break existing apps which has customized `ThemeData.dialogTheme`. * Changed the type of theme defaults from `DialogTheme` to `DialogThemeData`. TODO: * Fix internal failures. * Change the type of `ThemeData.dialogTheme` from `DialogTheme` to `DialogThemeData`. This may cause breaking changes, a migration guide will be created. Addresses the "theme normalization" sub project within https://github.com/flutter/flutter/issues/91772