Skip to content

Commit b68a71d

Browse files
Do not display subtitle if it's the same with title on payment details dialog
Closes #1303
1 parent 97d1dd9 commit b68a71d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/routes/home/widgets/payments_list/dialog/payment_details_dialog_content_title.dart

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ class PaymentDetailsDialogContentTitle extends StatelessWidget {
1313
@override
1414
Widget build(BuildContext context) {
1515
final themeData = Theme.of(context);
16-
final title = paymentInfo.dialogTitle?.replaceAll("\n", " ")?.trim();
16+
final dialogTitle = paymentInfo.dialogTitle?.replaceAll("\n", " ")?.trim();
1717
final description = paymentInfo.description?.trim();
18-
19-
if (title == null || title.isEmpty) {
18+
final hasNoDescription = description == null || description.isEmpty || dialogTitle == description;
19+
if (dialogTitle == null || dialogTitle.isEmpty) {
2020
return Container();
2121
}
2222

2323
return Padding(
2424
padding: EdgeInsets.only(
2525
left: 16.0,
2626
right: 16.0,
27-
bottom: (description == null || description.isEmpty) ? 16 : 8,
27+
bottom: (hasNoDescription) ? 16 : 8,
2828
),
2929
child: AutoSizeText(
30-
title,
30+
dialogTitle,
3131
style: themeData.primaryTextTheme.headlineSmall,
3232
textAlign: TextAlign.center,
3333
overflow: TextOverflow.ellipsis,

lib/routes/home/widgets/payments_list/dialog/payment_details_dialog_description.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ class PaymentDetailsDialogDescription extends StatelessWidget {
1414
Widget build(BuildContext context) {
1515
final themeData = Theme.of(context);
1616

17-
final description = paymentInfo.description;
18-
if (description == null || description == "") {
17+
final dialogTitle = paymentInfo.dialogTitle?.replaceAll("\n", " ")?.trim();
18+
final description = paymentInfo.description?.trim();
19+
final hasNoDescription = description == null || description.isEmpty || dialogTitle == description;
20+
if (hasNoDescription) {
1921
return Container();
2022
}
2123

0 commit comments

Comments
 (0)