From dc7409b64cfe63b3b9671ac10cc71c9f0b7f5a45 Mon Sep 17 00:00:00 2001 From: tuxpizza Date: Fri, 27 Dec 2024 14:50:56 -0500 Subject: [PATCH] Fix formatting [skip ci] --- .../dashboard/pages/balance/balance_page.dart | 10 +- .../pages/balance/balance_row_widget.dart | 32 +-- .../pages/balance/crypto_balance_widget.dart | 186 +++++++++--------- 3 files changed, 115 insertions(+), 113 deletions(-) diff --git a/lib/src/screens/dashboard/pages/balance/balance_page.dart b/lib/src/screens/dashboard/pages/balance/balance_page.dart index 6ad8798ea..b53d2d56b 100644 --- a/lib/src/screens/dashboard/pages/balance/balance_page.dart +++ b/lib/src/screens/dashboard/pages/balance/balance_page.dart @@ -42,7 +42,7 @@ class BalancePage extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w600, color: - Theme.of(context).extension()!.pageTitleTextColor, + Theme.of(context).extension()!.pageTitleTextColor, height: 1, ), unselectedLabelStyle: TextStyle( @@ -50,14 +50,14 @@ class BalancePage extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w600, color: - Theme.of(context).extension()!.pageTitleTextColor, + Theme.of(context).extension()!.pageTitleTextColor, height: 1, ), labelColor: - Theme.of(context).extension()!.pageTitleTextColor, + Theme.of(context).extension()!.pageTitleTextColor, dividerColor: Colors.transparent, indicatorColor: - Theme.of(context).extension()!.pageTitleTextColor, + Theme.of(context).extension()!.pageTitleTextColor, unselectedLabelColor: Theme.of(context) .extension()! .pageTitleTextColor @@ -85,4 +85,4 @@ class BalancePage extends StatelessWidget { }, ); } -} \ No newline at end of file +} diff --git a/lib/src/screens/dashboard/pages/balance/balance_row_widget.dart b/lib/src/screens/dashboard/pages/balance/balance_row_widget.dart index 9d26bd007..ac59b2411 100644 --- a/lib/src/screens/dashboard/pages/balance/balance_row_widget.dart +++ b/lib/src/screens/dashboard/pages/balance/balance_row_widget.dart @@ -77,11 +77,12 @@ class BalanceRowWidget extends StatelessWidget { color: Theme.of(context).extension()!.syncedBackgroundColor, boxShadow: [ BoxShadow( - color: Theme.of(context).extension()!.cardBorderColor + color: Theme.of(context) + .extension()! + .cardBorderColor .withAlpha(50), spreadRadius: 3, - blurRadius: 7 - ) + blurRadius: 7) ], ), child: Container( @@ -102,7 +103,7 @@ class BalanceRowWidget extends StatelessWidget { behavior: HitTestBehavior.opaque, onTap: hasAdditionalBalance ? () => _showBalanceDescription( - context, S.of(context).available_balance_description) + context, S.of(context).available_balance_description) : null, child: Row( children: [ @@ -152,7 +153,7 @@ class BalanceRowWidget extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w400, color: - Theme.of(context).extension()!.textColor, + Theme.of(context).extension()!.textColor, height: 1)), if (!isTestnet) Text('${availableFiatBalance}', @@ -162,7 +163,7 @@ class BalanceRowWidget extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w500, color: - Theme.of(context).extension()!.textColor, + Theme.of(context).extension()!.textColor, height: 1)), ], ), @@ -215,7 +216,7 @@ class BalanceRowWidget extends StatelessWidget { behavior: HitTestBehavior.opaque, onTap: hasAdditionalBalance ? () => _showBalanceDescription( - context, S.of(context).unavailable_balance_description) + context, S.of(context).unavailable_balance_description) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -231,7 +232,7 @@ class BalanceRowWidget extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w400, color: - Theme.of(context).extension()!.labelTextColor, + Theme.of(context).extension()!.labelTextColor, height: 1, ), ), @@ -253,7 +254,7 @@ class BalanceRowWidget extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w400, color: - Theme.of(context).extension()!.balanceAmountColor, + Theme.of(context).extension()!.balanceAmountColor, height: 1, ), maxLines: 1, @@ -339,11 +340,12 @@ class BalanceRowWidget extends StatelessWidget { color: Theme.of(context).extension()!.syncedBackgroundColor, boxShadow: [ BoxShadow( - color: Theme.of(context).extension()!.cardBorderColor + color: Theme.of(context) + .extension()! + .cardBorderColor .withAlpha(50), spreadRadius: 3, - blurRadius: 7 - ) + blurRadius: 7) ], ), child: Container( @@ -541,7 +543,7 @@ class BalanceRowWidget extends StatelessWidget { child: OutlinedButton( onPressed: () { final mwebAddress = - bitcoin!.getUnusedMwebAddress(dashboardViewModel.wallet); + bitcoin!.getUnusedMwebAddress(dashboardViewModel.wallet); PaymentRequest? paymentRequest = null; if ((mwebAddress?.isNotEmpty ?? false)) { paymentRequest = PaymentRequest.fromUri( @@ -599,7 +601,7 @@ class BalanceRowWidget extends StatelessWidget { child: OutlinedButton( onPressed: () { final litecoinAddress = - bitcoin!.getUnusedSegwitAddress(dashboardViewModel.wallet); + bitcoin!.getUnusedSegwitAddress(dashboardViewModel.wallet); PaymentRequest? paymentRequest = null; if ((litecoinAddress?.isNotEmpty ?? false)) { paymentRequest = PaymentRequest.fromUri( @@ -667,4 +669,4 @@ class BalanceRowWidget extends StatelessWidget { void _showBalanceDescription(BuildContext context, String content) { showPopUp(context: context, builder: (_) => InformationPage(information: content)); } -} \ No newline at end of file +} diff --git a/lib/src/screens/dashboard/pages/balance/crypto_balance_widget.dart b/lib/src/screens/dashboard/pages/balance/crypto_balance_widget.dart index 5bd001ffe..3e39b9444 100644 --- a/lib/src/screens/dashboard/pages/balance/crypto_balance_widget.dart +++ b/lib/src/screens/dashboard/pages/balance/crypto_balance_widget.dart @@ -63,63 +63,63 @@ class CryptoBalanceWidget extends StatelessWidget { Observer( builder: (_) => dashboardViewModel.balanceViewModel.hasAccounts ? HomeScreenAccountWidget( - walletName: dashboardViewModel.name, accountName: dashboardViewModel.subname) + walletName: dashboardViewModel.name, accountName: dashboardViewModel.subname) : Column( - children: [ - SizedBox(height: 16), - Container( - margin: const EdgeInsets.only(left: 24, bottom: 16), - child: Observer( - builder: (_) { - return Row( - children: [ - Text( - dashboardViewModel.balanceViewModel.asset, - style: TextStyle( - fontSize: 24, - fontFamily: 'Lato', - fontWeight: FontWeight.w600, - color: Theme.of(context) - .extension()! - .pageTitleTextColor, - height: 1, - ), - maxLines: 1, - textAlign: TextAlign.center, - ), - if (dashboardViewModel.wallet.isHardwareWallet) - Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/hardware_wallet/ledger_nano_x.png', - width: 24, - color: Theme.of(context) - .extension()! - .pageTitleTextColor, - ), - ), - if (dashboardViewModel - .balanceViewModel.isHomeScreenSettingsEnabled) - InkWell( - onTap: () => Navigator.pushNamed(context, Routes.homeSettings, - arguments: dashboardViewModel.balanceViewModel), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/home_screen_settings_icon.png', - color: Theme.of(context) - .extension()! - .pageTitleTextColor, + children: [ + SizedBox(height: 16), + Container( + margin: const EdgeInsets.only(left: 24, bottom: 16), + child: Observer( + builder: (_) { + return Row( + children: [ + Text( + dashboardViewModel.balanceViewModel.asset, + style: TextStyle( + fontSize: 24, + fontFamily: 'Lato', + fontWeight: FontWeight.w600, + color: Theme.of(context) + .extension()! + .pageTitleTextColor, + height: 1, + ), + maxLines: 1, + textAlign: TextAlign.center, ), - ), - ), - ], - ); - }, - ), - ), - ], - )), + if (dashboardViewModel.wallet.isHardwareWallet) + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/hardware_wallet/ledger_nano_x.png', + width: 24, + color: Theme.of(context) + .extension()! + .pageTitleTextColor, + ), + ), + if (dashboardViewModel + .balanceViewModel.isHomeScreenSettingsEnabled) + InkWell( + onTap: () => Navigator.pushNamed(context, Routes.homeSettings, + arguments: dashboardViewModel.balanceViewModel), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/home_screen_settings_icon.png', + color: Theme.of(context) + .extension()! + .pageTitleTextColor, + ), + ), + ), + ], + ); + }, + ), + ), + ], + )), Observer( builder: (_) { if (dashboardViewModel.balanceViewModel.isShowCard && FeatureFlag.isCakePayEnabled) { @@ -157,35 +157,35 @@ class CryptoBalanceWidget extends StatelessWidget { itemCount: dashboardViewModel.balanceViewModel.formattedBalances.length, itemBuilder: (__, index) { final balance = - dashboardViewModel.balanceViewModel.formattedBalances.elementAt(index); + dashboardViewModel.balanceViewModel.formattedBalances.elementAt(index); return Observer(builder: (_) { return BalanceRowWidget( dashboardViewModel: dashboardViewModel, availableBalanceLabel: - '${dashboardViewModel.balanceViewModel.availableBalanceLabel}', + '${dashboardViewModel.balanceViewModel.availableBalanceLabel}', availableBalance: balance.availableBalance, availableFiatBalance: balance.fiatAvailableBalance, additionalBalanceLabel: - '${dashboardViewModel.balanceViewModel.additionalBalanceLabel}', + '${dashboardViewModel.balanceViewModel.additionalBalanceLabel}', additionalBalance: balance.additionalBalance, additionalFiatBalance: balance.fiatAdditionalBalance, frozenBalance: balance.frozenBalance, frozenFiatBalance: balance.fiatFrozenBalance, currency: balance.asset, hasAdditionalBalance: - dashboardViewModel.balanceViewModel.hasAdditionalBalance, + dashboardViewModel.balanceViewModel.hasAdditionalBalance, hasSecondAdditionalBalance: - dashboardViewModel.balanceViewModel.hasSecondAdditionalBalance, + dashboardViewModel.balanceViewModel.hasSecondAdditionalBalance, hasSecondAvailableBalance: - dashboardViewModel.balanceViewModel.hasSecondAvailableBalance, + dashboardViewModel.balanceViewModel.hasSecondAvailableBalance, secondAdditionalBalance: balance.secondAdditionalBalance, secondAdditionalFiatBalance: balance.fiatSecondAdditionalBalance, secondAvailableBalance: balance.secondAvailableBalance, secondAvailableFiatBalance: balance.fiatSecondAvailableBalance, secondAdditionalBalanceLabel: - '${dashboardViewModel.balanceViewModel.secondAdditionalBalanceLabel}', + '${dashboardViewModel.balanceViewModel.secondAdditionalBalanceLabel}', secondAvailableBalanceLabel: - '${dashboardViewModel.balanceViewModel.secondAvailableBalanceLabel}', + '${dashboardViewModel.balanceViewModel.secondAvailableBalanceLabel}', isTestnet: dashboardViewModel.isTestnet, ); }); @@ -272,7 +272,7 @@ class CryptoBalanceWidget extends StatelessWidget { icon: Icon( Icons.lock, color: - Theme.of(context).extension()!.pageTitleTextColor, + Theme.of(context).extension()!.pageTitleTextColor, size: 50, ), ), @@ -304,7 +304,7 @@ class CryptoBalanceWidget extends StatelessWidget { fontFamily: 'Lato', fontWeight: FontWeight.w400, color: - Theme.of(context).extension()!.labelTextColor, + Theme.of(context).extension()!.labelTextColor, height: 1, ), softWrap: true, @@ -379,19 +379,19 @@ class CryptoBalanceWidget extends StatelessWidget { return showPopUp( context: context, builder: (BuildContext context) => AlertWithTwoActions( - alertTitle: S.of(context).change_current_node_title, - alertContent: S.of(context).confirm_silent_payments_switch_node, - rightButtonText: S.of(context).confirm, - leftButtonText: S.of(context).cancel, - actionRightButton: () { - dashboardViewModel.setSilentPaymentsScanning(newValue); - Navigator.of(context).pop(); - }, - actionLeftButton: () { - dashboardViewModel.silentPaymentsScanningActive = isSilentPaymentsScanningActive; - Navigator.of(context).pop(); - }, - )); + alertTitle: S.of(context).change_current_node_title, + alertContent: S.of(context).confirm_silent_payments_switch_node, + rightButtonText: S.of(context).confirm, + leftButtonText: S.of(context).cancel, + actionRightButton: () { + dashboardViewModel.setSilentPaymentsScanning(newValue); + Navigator.of(context).pop(); + }, + actionLeftButton: () { + dashboardViewModel.silentPaymentsScanningActive = isSilentPaymentsScanningActive; + Navigator.of(context).pop(); + }, + )); } return dashboardViewModel.setSilentPaymentsScanning(newValue); @@ -402,13 +402,13 @@ class CryptoBalanceWidget extends StatelessWidget { await showPopUp( context: context, builder: (BuildContext context) => AlertWithOneAction( - alertTitle: S.of(context).alert_notice, - alertContent: S.of(context).litecoin_mweb_warning, - buttonText: S.of(context).understand, - buttonAction: () { - Navigator.of(context).pop(); - }, - )); + alertTitle: S.of(context).alert_notice, + alertContent: S.of(context).litecoin_mweb_warning, + buttonText: S.of(context).understand, + buttonAction: () { + Navigator.of(context).pop(); + }, + )); } dashboardViewModel.setMwebEnabled(); } @@ -417,13 +417,13 @@ class CryptoBalanceWidget extends StatelessWidget { await showPopUp( context: context, builder: (BuildContext context) => AlertWithOneAction( - alertTitle: S.of(context).alert_notice, - alertContent: S.of(context).litecoin_mweb_enable_later, - buttonText: S.of(context).understand, - buttonAction: () { - Navigator.of(context).pop(); - }, - )); + alertTitle: S.of(context).alert_notice, + alertContent: S.of(context).litecoin_mweb_enable_later, + buttonText: S.of(context).understand, + buttonAction: () { + Navigator.of(context).pop(); + }, + )); dashboardViewModel.dismissMweb(); } -} \ No newline at end of file +}