Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not display subtitle if it's the same with title on payment details dialog #1304

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading