mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-08 20:09:24 +00:00
Fix formatting [skip ci]
This commit is contained in:
parent
229c6c08fe
commit
dc7409b64c
3 changed files with 115 additions and 113 deletions
|
@ -42,7 +42,7 @@ class BalancePage extends StatelessWidget {
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
unselectedLabelStyle: TextStyle(
|
unselectedLabelStyle: TextStyle(
|
||||||
|
@ -50,14 +50,14 @@ class BalancePage extends StatelessWidget {
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
labelColor:
|
labelColor:
|
||||||
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
||||||
dividerColor: Colors.transparent,
|
dividerColor: Colors.transparent,
|
||||||
indicatorColor:
|
indicatorColor:
|
||||||
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
||||||
unselectedLabelColor: Theme.of(context)
|
unselectedLabelColor: Theme.of(context)
|
||||||
.extension<DashboardPageTheme>()!
|
.extension<DashboardPageTheme>()!
|
||||||
.pageTitleTextColor
|
.pageTitleTextColor
|
||||||
|
|
|
@ -77,11 +77,12 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
|
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor
|
color: Theme.of(context)
|
||||||
|
.extension<BalancePageTheme>()!
|
||||||
|
.cardBorderColor
|
||||||
.withAlpha(50),
|
.withAlpha(50),
|
||||||
spreadRadius: 3,
|
spreadRadius: 3,
|
||||||
blurRadius: 7
|
blurRadius: 7)
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -102,7 +103,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: hasAdditionalBalance
|
onTap: hasAdditionalBalance
|
||||||
? () => _showBalanceDescription(
|
? () => _showBalanceDescription(
|
||||||
context, S.of(context).available_balance_description)
|
context, S.of(context).available_balance_description)
|
||||||
: null,
|
: null,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
|
@ -152,7 +153,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<BalancePageTheme>()!.textColor,
|
Theme.of(context).extension<BalancePageTheme>()!.textColor,
|
||||||
height: 1)),
|
height: 1)),
|
||||||
if (!isTestnet)
|
if (!isTestnet)
|
||||||
Text('${availableFiatBalance}',
|
Text('${availableFiatBalance}',
|
||||||
|
@ -162,7 +163,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<BalancePageTheme>()!.textColor,
|
Theme.of(context).extension<BalancePageTheme>()!.textColor,
|
||||||
height: 1)),
|
height: 1)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -215,7 +216,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: hasAdditionalBalance
|
onTap: hasAdditionalBalance
|
||||||
? () => _showBalanceDescription(
|
? () => _showBalanceDescription(
|
||||||
context, S.of(context).unavailable_balance_description)
|
context, S.of(context).unavailable_balance_description)
|
||||||
: null,
|
: null,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -231,7 +232,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
|
Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -253,7 +254,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<BalancePageTheme>()!.balanceAmountColor,
|
Theme.of(context).extension<BalancePageTheme>()!.balanceAmountColor,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
|
@ -339,11 +340,12 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
|
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor
|
color: Theme.of(context)
|
||||||
|
.extension<BalancePageTheme>()!
|
||||||
|
.cardBorderColor
|
||||||
.withAlpha(50),
|
.withAlpha(50),
|
||||||
spreadRadius: 3,
|
spreadRadius: 3,
|
||||||
blurRadius: 7
|
blurRadius: 7)
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -541,7 +543,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final mwebAddress =
|
final mwebAddress =
|
||||||
bitcoin!.getUnusedMwebAddress(dashboardViewModel.wallet);
|
bitcoin!.getUnusedMwebAddress(dashboardViewModel.wallet);
|
||||||
PaymentRequest? paymentRequest = null;
|
PaymentRequest? paymentRequest = null;
|
||||||
if ((mwebAddress?.isNotEmpty ?? false)) {
|
if ((mwebAddress?.isNotEmpty ?? false)) {
|
||||||
paymentRequest = PaymentRequest.fromUri(
|
paymentRequest = PaymentRequest.fromUri(
|
||||||
|
@ -599,7 +601,7 @@ class BalanceRowWidget extends StatelessWidget {
|
||||||
child: OutlinedButton(
|
child: OutlinedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final litecoinAddress =
|
final litecoinAddress =
|
||||||
bitcoin!.getUnusedSegwitAddress(dashboardViewModel.wallet);
|
bitcoin!.getUnusedSegwitAddress(dashboardViewModel.wallet);
|
||||||
PaymentRequest? paymentRequest = null;
|
PaymentRequest? paymentRequest = null;
|
||||||
if ((litecoinAddress?.isNotEmpty ?? false)) {
|
if ((litecoinAddress?.isNotEmpty ?? false)) {
|
||||||
paymentRequest = PaymentRequest.fromUri(
|
paymentRequest = PaymentRequest.fromUri(
|
||||||
|
|
|
@ -63,63 +63,63 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||||
Observer(
|
Observer(
|
||||||
builder: (_) => dashboardViewModel.balanceViewModel.hasAccounts
|
builder: (_) => dashboardViewModel.balanceViewModel.hasAccounts
|
||||||
? HomeScreenAccountWidget(
|
? HomeScreenAccountWidget(
|
||||||
walletName: dashboardViewModel.name, accountName: dashboardViewModel.subname)
|
walletName: dashboardViewModel.name, accountName: dashboardViewModel.subname)
|
||||||
: Column(
|
: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
Container(
|
Container(
|
||||||
margin: const EdgeInsets.only(left: 24, bottom: 16),
|
margin: const EdgeInsets.only(left: 24, bottom: 16),
|
||||||
child: Observer(
|
child: Observer(
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
dashboardViewModel.balanceViewModel.asset,
|
dashboardViewModel.balanceViewModel.asset,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.extension<DashboardPageTheme>()!
|
.extension<DashboardPageTheme>()!
|
||||||
.pageTitleTextColor,
|
.pageTitleTextColor,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
textAlign: TextAlign.center,
|
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<DashboardPageTheme>()!
|
|
||||||
.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<DashboardPageTheme>()!
|
|
||||||
.pageTitleTextColor,
|
|
||||||
),
|
),
|
||||||
),
|
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<DashboardPageTheme>()!
|
||||||
)),
|
.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<DashboardPageTheme>()!
|
||||||
|
.pageTitleTextColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
Observer(
|
Observer(
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
if (dashboardViewModel.balanceViewModel.isShowCard && FeatureFlag.isCakePayEnabled) {
|
if (dashboardViewModel.balanceViewModel.isShowCard && FeatureFlag.isCakePayEnabled) {
|
||||||
|
@ -157,35 +157,35 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||||
itemCount: dashboardViewModel.balanceViewModel.formattedBalances.length,
|
itemCount: dashboardViewModel.balanceViewModel.formattedBalances.length,
|
||||||
itemBuilder: (__, index) {
|
itemBuilder: (__, index) {
|
||||||
final balance =
|
final balance =
|
||||||
dashboardViewModel.balanceViewModel.formattedBalances.elementAt(index);
|
dashboardViewModel.balanceViewModel.formattedBalances.elementAt(index);
|
||||||
return Observer(builder: (_) {
|
return Observer(builder: (_) {
|
||||||
return BalanceRowWidget(
|
return BalanceRowWidget(
|
||||||
dashboardViewModel: dashboardViewModel,
|
dashboardViewModel: dashboardViewModel,
|
||||||
availableBalanceLabel:
|
availableBalanceLabel:
|
||||||
'${dashboardViewModel.balanceViewModel.availableBalanceLabel}',
|
'${dashboardViewModel.balanceViewModel.availableBalanceLabel}',
|
||||||
availableBalance: balance.availableBalance,
|
availableBalance: balance.availableBalance,
|
||||||
availableFiatBalance: balance.fiatAvailableBalance,
|
availableFiatBalance: balance.fiatAvailableBalance,
|
||||||
additionalBalanceLabel:
|
additionalBalanceLabel:
|
||||||
'${dashboardViewModel.balanceViewModel.additionalBalanceLabel}',
|
'${dashboardViewModel.balanceViewModel.additionalBalanceLabel}',
|
||||||
additionalBalance: balance.additionalBalance,
|
additionalBalance: balance.additionalBalance,
|
||||||
additionalFiatBalance: balance.fiatAdditionalBalance,
|
additionalFiatBalance: balance.fiatAdditionalBalance,
|
||||||
frozenBalance: balance.frozenBalance,
|
frozenBalance: balance.frozenBalance,
|
||||||
frozenFiatBalance: balance.fiatFrozenBalance,
|
frozenFiatBalance: balance.fiatFrozenBalance,
|
||||||
currency: balance.asset,
|
currency: balance.asset,
|
||||||
hasAdditionalBalance:
|
hasAdditionalBalance:
|
||||||
dashboardViewModel.balanceViewModel.hasAdditionalBalance,
|
dashboardViewModel.balanceViewModel.hasAdditionalBalance,
|
||||||
hasSecondAdditionalBalance:
|
hasSecondAdditionalBalance:
|
||||||
dashboardViewModel.balanceViewModel.hasSecondAdditionalBalance,
|
dashboardViewModel.balanceViewModel.hasSecondAdditionalBalance,
|
||||||
hasSecondAvailableBalance:
|
hasSecondAvailableBalance:
|
||||||
dashboardViewModel.balanceViewModel.hasSecondAvailableBalance,
|
dashboardViewModel.balanceViewModel.hasSecondAvailableBalance,
|
||||||
secondAdditionalBalance: balance.secondAdditionalBalance,
|
secondAdditionalBalance: balance.secondAdditionalBalance,
|
||||||
secondAdditionalFiatBalance: balance.fiatSecondAdditionalBalance,
|
secondAdditionalFiatBalance: balance.fiatSecondAdditionalBalance,
|
||||||
secondAvailableBalance: balance.secondAvailableBalance,
|
secondAvailableBalance: balance.secondAvailableBalance,
|
||||||
secondAvailableFiatBalance: balance.fiatSecondAvailableBalance,
|
secondAvailableFiatBalance: balance.fiatSecondAvailableBalance,
|
||||||
secondAdditionalBalanceLabel:
|
secondAdditionalBalanceLabel:
|
||||||
'${dashboardViewModel.balanceViewModel.secondAdditionalBalanceLabel}',
|
'${dashboardViewModel.balanceViewModel.secondAdditionalBalanceLabel}',
|
||||||
secondAvailableBalanceLabel:
|
secondAvailableBalanceLabel:
|
||||||
'${dashboardViewModel.balanceViewModel.secondAvailableBalanceLabel}',
|
'${dashboardViewModel.balanceViewModel.secondAvailableBalanceLabel}',
|
||||||
isTestnet: dashboardViewModel.isTestnet,
|
isTestnet: dashboardViewModel.isTestnet,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -272,7 +272,7 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.lock,
|
Icons.lock,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
Theme.of(context).extension<DashboardPageTheme>()!.pageTitleTextColor,
|
||||||
size: 50,
|
size: 50,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -304,7 +304,7 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||||
fontFamily: 'Lato',
|
fontFamily: 'Lato',
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color:
|
color:
|
||||||
Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
|
Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
|
||||||
height: 1,
|
height: 1,
|
||||||
),
|
),
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
|
@ -379,19 +379,19 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||||
return showPopUp<void>(
|
return showPopUp<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AlertWithTwoActions(
|
builder: (BuildContext context) => AlertWithTwoActions(
|
||||||
alertTitle: S.of(context).change_current_node_title,
|
alertTitle: S.of(context).change_current_node_title,
|
||||||
alertContent: S.of(context).confirm_silent_payments_switch_node,
|
alertContent: S.of(context).confirm_silent_payments_switch_node,
|
||||||
rightButtonText: S.of(context).confirm,
|
rightButtonText: S.of(context).confirm,
|
||||||
leftButtonText: S.of(context).cancel,
|
leftButtonText: S.of(context).cancel,
|
||||||
actionRightButton: () {
|
actionRightButton: () {
|
||||||
dashboardViewModel.setSilentPaymentsScanning(newValue);
|
dashboardViewModel.setSilentPaymentsScanning(newValue);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
actionLeftButton: () {
|
actionLeftButton: () {
|
||||||
dashboardViewModel.silentPaymentsScanningActive = isSilentPaymentsScanningActive;
|
dashboardViewModel.silentPaymentsScanningActive = isSilentPaymentsScanningActive;
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return dashboardViewModel.setSilentPaymentsScanning(newValue);
|
return dashboardViewModel.setSilentPaymentsScanning(newValue);
|
||||||
|
@ -402,13 +402,13 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||||
await showPopUp<void>(
|
await showPopUp<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AlertWithOneAction(
|
builder: (BuildContext context) => AlertWithOneAction(
|
||||||
alertTitle: S.of(context).alert_notice,
|
alertTitle: S.of(context).alert_notice,
|
||||||
alertContent: S.of(context).litecoin_mweb_warning,
|
alertContent: S.of(context).litecoin_mweb_warning,
|
||||||
buttonText: S.of(context).understand,
|
buttonText: S.of(context).understand,
|
||||||
buttonAction: () {
|
buttonAction: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
dashboardViewModel.setMwebEnabled();
|
dashboardViewModel.setMwebEnabled();
|
||||||
}
|
}
|
||||||
|
@ -417,13 +417,13 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||||
await showPopUp<void>(
|
await showPopUp<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AlertWithOneAction(
|
builder: (BuildContext context) => AlertWithOneAction(
|
||||||
alertTitle: S.of(context).alert_notice,
|
alertTitle: S.of(context).alert_notice,
|
||||||
alertContent: S.of(context).litecoin_mweb_enable_later,
|
alertContent: S.of(context).litecoin_mweb_enable_later,
|
||||||
buttonText: S.of(context).understand,
|
buttonText: S.of(context).understand,
|
||||||
buttonAction: () {
|
buttonAction: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
dashboardViewModel.dismissMweb();
|
dashboardViewModel.dismissMweb();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue