Skip to content

Commit

Permalink
Do not display subtitle if it's the same with title on payment detail…
Browse files Browse the repository at this point in the history
…s dialog

Closes #1303
  • Loading branch information
erdemyerebasmaz committed Jul 25, 2024
1 parent 97d1dd9 commit b68a71d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ class PaymentDetailsDialogContentTitle extends StatelessWidget {
@override
Widget build(BuildContext context) {
final themeData = Theme.of(context);
final title = paymentInfo.dialogTitle?.replaceAll("\n", " ")?.trim();
final dialogTitle = paymentInfo.dialogTitle?.replaceAll("\n", " ")?.trim();
final description = paymentInfo.description?.trim();

if (title == null || title.isEmpty) {
final hasNoDescription = description == null || description.isEmpty || dialogTitle == description;
if (dialogTitle == null || dialogTitle.isEmpty) {
return Container();
}

return Padding(
padding: EdgeInsets.only(
left: 16.0,
right: 16.0,
bottom: (description == null || description.isEmpty) ? 16 : 8,
bottom: (hasNoDescription) ? 16 : 8,
),
child: AutoSizeText(
title,
dialogTitle,
style: themeData.primaryTextTheme.headlineSmall,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ class PaymentDetailsDialogDescription extends StatelessWidget {
Widget build(BuildContext context) {
final themeData = Theme.of(context);

final description = paymentInfo.description;
if (description == null || description == "") {
final dialogTitle = paymentInfo.dialogTitle?.replaceAll("\n", " ")?.trim();
final description = paymentInfo.description?.trim();
final hasNoDescription = description == null || description.isEmpty || dialogTitle == description;
if (hasNoDescription) {
return Container();
}

Expand Down

0 comments on commit b68a71d

Please sign in to comment.