Skip to content

Commit

Permalink
Enhance dialog title styling with DefaultTextStyle for better text ha…
Browse files Browse the repository at this point in the history
…ndling
  • Loading branch information
frankmer committed Feb 7, 2025
1 parent 498ebda commit bbd0ab7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 8 additions & 1 deletion lib/widgets/dialog_widgets/default_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ class DefaultDialog extends StatelessWidget {
title: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(child: title ?? const SizedBox()),
Expanded(
child: DefaultTextStyle(
style: Theme.of(context).textTheme.titleLarge!,
maxLines: 2,
overflow: TextOverflow.ellipsis,
child: title ?? const SizedBox(),
),
),
if (hasCloseButton)
SizedBox(
width: closeButtonSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,7 @@ class _PushRequestDialogState extends ConsumerState<PushRequestDialog> {
color: Colors.transparent,
child: DefaultDialog(
scrollable: false,
title: Text(
title,
style: Theme.of(context).textTheme.titleMedium!,
maxLines: 2,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
),
title: Text(title),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
Expand Down

0 comments on commit bbd0ab7

Please sign in to comment.