Skip to content

Commit 9aa68b2

Browse files
committed
dialog: Start-align dialog content on iOS, instead of center-align
We're about to show a stack trace in an error dialog, and it'll be easier to read when start-aligned than center-aligned. Applying it here with DefaultTextStyle, rather than on each Text widget, to avoid repetition, particularly because one caller (of _adaptiveContent) passes multiple Text widgets and we'd have to handle each of those; that's in UpgradeWelcomeDialog.
1 parent 80f5a85 commit 9aa68b2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/widgets/dialog.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,14 @@ Widget? _adaptiveContent(Widget? content) {
6363
case TargetPlatform.macOS:
6464
// A [SingleChildScrollView] (wrapping both title and content) is already
6565
// created by [CupertinoAlertDialog].
66-
return content;
66+
return DefaultTextStyle.merge(
67+
// The "alert description" is start-aligned in one example in Apple's
68+
// HIG document:
69+
// https://developer.apple.com/design/human-interface-guidelines/alerts#Anatomy
70+
// (Confusingly, in 2025-10, it's center-aligned in the graphic at the
71+
// *top* of that page; shrug.)
72+
textAlign: TextAlign.start,
73+
child: content);
6774
}
6875
}
6976

0 commit comments

Comments
 (0)