From 7b16b36573887c5c87d244fe90dfe34038d29f1b Mon Sep 17 00:00:00 2001 From: tommytrg Date: Fri, 25 Oct 2024 18:48:47 +0200 Subject: [PATCH] feat: update header flow in modals --- lib/l10n/app_en.arb | 2 +- lib/widgets/alert_dialog.dart | 32 +++++++++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 18ac8b84..c3f5bcae 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -152,7 +152,7 @@ "downloading": "Downloading...", "drSolved": "Data requests solved", "emptyStakeMessage": "Stake some $WIT! Secure the network, earn rewards, and be part of a censorship-resistant oracle.", - "emptyStakeTitle": "You donĀ“t have balance to unstake", + "emptyStakeTitle": "You don't have balance to unstake", "enableLoginWithBiometrics": "Enable login with biometrics", "encryptWallet01": "This password encrypts your Witnet wallet only on this computer.", "encryptWallet02": "This is not your backup and you cannot restore your wallet with this password.", diff --git a/lib/widgets/alert_dialog.dart b/lib/widgets/alert_dialog.dart index 4f2584a5..63d5fb4c 100644 --- a/lib/widgets/alert_dialog.dart +++ b/lib/widgets/alert_dialog.dart @@ -19,19 +19,33 @@ buildAlertDialog({ context: context, barrierDismissible: closable, builder: (BuildContext context) => AlertDialog( - title: Text( - textAlign: TextAlign.center, - title, - style: theme.textTheme.titleLarge, + title: Padding( + padding: const EdgeInsets.only(bottom: 16), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (icon != null) + Icon( + icon, + size: 24, + color: color ?? WitnetPallet.brightCyan, + ), + const SizedBox(width: 8), + Align( + alignment: Alignment.centerLeft, + child: Text( + title, + style: theme.textTheme.titleLarge, + ), + ), + ], + ), ), backgroundColor: theme.colorScheme.surface, surfaceTintColor: theme.colorScheme.surface, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(extendedTheme.borderRadius!)), - icon: icon != null - ? Icon(icon, - size: 24, color: color ?? WitnetPallet.brightCyan) - : null, + borderRadius: BorderRadius.all(extendedTheme.borderRadius!), + ), actionsPadding: EdgeInsets.only(bottom: 16, right: 16, top: 0), content: ConstrainedBox( constraints: BoxConstraints(maxWidth: 300), child: content),