Skip to content

Commit dde616d

Browse files
authored
Update documentation of AlertDialog's default TextStyle for Material 3 (#144697)
## Update `AlertDialog` Documentation for Material 3 Defaults This pull request updates the documentation for `AlertDialog` to accurately reflect the default text styles (`titleTextStyle` and `contentTextStyle`) when using Material 3. Previously, the documentation suggested default styles (`TextTheme.titleLarge` for titles and `TextTheme.titleMedium` for content) that do not align with Material 3 implementation, which uses `TextTheme.headlineSmall` and `TextTheme.bodyMedium` respectively. Fixes #144489
1 parent d632f34 commit dde616d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/flutter/lib/src/material/dialog.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@ class AlertDialog extends StatelessWidget {
508508
/// Style for the text in the [title] of this [AlertDialog].
509509
///
510510
/// If null, [DialogTheme.titleTextStyle] is used. If that's null, defaults to
511-
/// [TextTheme.titleLarge] of [ThemeData.textTheme].
511+
/// [TextTheme.headlineSmall] of [ThemeData.textTheme] if
512+
/// [ThemeData.useMaterial3] is true, [TextTheme.titleLarge] otherwise.
512513
final TextStyle? titleTextStyle;
513514

514515
/// The (optional) content of the dialog is displayed in the center of the
@@ -542,7 +543,8 @@ class AlertDialog extends StatelessWidget {
542543
/// Style for the text in the [content] of this [AlertDialog].
543544
///
544545
/// If null, [DialogTheme.contentTextStyle] is used. If that's null, defaults
545-
/// to [TextTheme.titleMedium] of [ThemeData.textTheme].
546+
/// to [TextTheme.bodyMedium] of [ThemeData.textTheme] if
547+
/// [ThemeData.useMaterial3] is true, [TextTheme.titleMedium] otherwise.
546548
final TextStyle? contentTextStyle;
547549

548550
/// The (optional) set of actions that are displayed at the bottom of the

0 commit comments

Comments
 (0)