Skip to content

Commit

Permalink
Display expiration field only if pending expiration block is larger t…
Browse files Browse the repository at this point in the history
…han current block height
  • Loading branch information
erdemyerebasmaz committed Apr 14, 2024
1 parent 01e04e7 commit 906ecc9
Showing 1 changed file with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ class PaymentDetailsDialogExpiration extends StatelessWidget {
final pendingExpirationBlock = paymentMinutiae.pendingExpirationBlock;
final currentBlockHeight = context.select<AccountBloc, int>((value) => value.state.blockheight);

return Container(
height: 36.0,
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: AutoSizeText(
texts.payment_details_dialog_expiration,
style: themeData.primaryTextTheme.headlineMedium,
textAlign: TextAlign.left,
maxLines: 1,
group: labelAutoSizeGroup,
if (pendingExpirationBlock != null && pendingExpirationBlock > currentBlockHeight) {
return Container(
height: 36.0,
padding: const EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0),
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: AutoSizeText(
texts.payment_details_dialog_expiration,
style: themeData.primaryTextTheme.headlineMedium,
textAlign: TextAlign.left,
maxLines: 1,
group: labelAutoSizeGroup,
),
),
),
if (pendingExpirationBlock != null && pendingExpirationBlock > currentBlockHeight) ...[
Expanded(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
Expand All @@ -54,7 +54,9 @@ class PaymentDetailsDialogExpiration extends StatelessWidget {
child: AutoSizeText(
BreezDateUtils.formatYearMonthDayHourMinute(
BreezDateUtils.blockDiffToDate(
blockHeight: currentBlockHeight, expiryBlock: pendingExpirationBlock),
blockHeight: currentBlockHeight,
expiryBlock: pendingExpirationBlock,
),
),
style: themeData.primaryTextTheme.displaySmall,
textAlign: TextAlign.right,
Expand All @@ -63,8 +65,10 @@ class PaymentDetailsDialogExpiration extends StatelessWidget {
),
),
],
],
),
);
),
);
} else {
return Container();
}
}
}

0 comments on commit 906ecc9

Please sign in to comment.