From dde616dbe127cbabbfd30b334af7c5c006e57413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20de=20Porcaro?= <65758246+Nenuphar12@users.noreply.github.com> Date: Fri, 8 Mar 2024 01:21:35 +0100 Subject: [PATCH] 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 --- packages/flutter/lib/src/material/dialog.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 3d8336fc011..1659dad97a0 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -508,7 +508,8 @@ class AlertDialog extends StatelessWidget { /// Style for the text in the [title] of this [AlertDialog]. /// /// If null, [DialogTheme.titleTextStyle] is used. If that's null, defaults to - /// [TextTheme.titleLarge] of [ThemeData.textTheme]. + /// [TextTheme.headlineSmall] of [ThemeData.textTheme] if + /// [ThemeData.useMaterial3] is true, [TextTheme.titleLarge] otherwise. final TextStyle? titleTextStyle; /// The (optional) content of the dialog is displayed in the center of the @@ -542,7 +543,8 @@ class AlertDialog extends StatelessWidget { /// Style for the text in the [content] of this [AlertDialog]. /// /// If null, [DialogTheme.contentTextStyle] is used. If that's null, defaults - /// to [TextTheme.titleMedium] of [ThemeData.textTheme]. + /// to [TextTheme.bodyMedium] of [ThemeData.textTheme] if + /// [ThemeData.useMaterial3] is true, [TextTheme.titleMedium] otherwise. final TextStyle? contentTextStyle; /// The (optional) set of actions that are displayed at the bottom of the