Balance card fixes (#1933)
Some checks failed
Cache Dependencies / test (push) Has been cancelled

This commit is contained in:
tuxsudo 2025-01-04 01:50:06 -05:00 committed by GitHub
parent da9c309805
commit cee3abcb72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 160 additions and 197 deletions

View file

@ -78,15 +78,13 @@ class BalanceRowWidget extends StatelessWidget {
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
),
child: TextButton(
onPressed: () =>
Fluttertoast.showToast(
onPressed: () => Fluttertoast.showToast(
msg: S.current.show_balance_toast,
backgroundColor: Color.fromRGBO(0, 0, 0, 0.85),
),
onLongPress: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
),
child: Container(
margin: const EdgeInsets.only(top: 10, left: 12, right: 12, bottom: 10),
@ -103,11 +101,8 @@ class BalanceRowWidget extends StatelessWidget {
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: hasAdditionalBalance
? () =>
_showBalanceDescription(
context, S
.of(context)
.available_balance_description)
? () => _showBalanceDescription(
context, S.of(context).available_balance_description)
: null,
child: Row(
children: [
@ -150,9 +145,7 @@ class BalanceRowWidget extends StatelessWidget {
textAlign: TextAlign.start),
SizedBox(height: 6),
if (isTestnet)
Text(S
.of(context)
.testnet_coins_no_value,
Text(S.of(context).testnet_coins_no_value,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
@ -218,25 +211,14 @@ class BalanceRowWidget extends StatelessWidget {
),
//),
if (frozenBalance.isNotEmpty)
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: hasAdditionalBalance
? () =>
_showBalanceDescription(
context, S
.of(context)
.unavailable_balance_description)
: null,
child: Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 26),
Row(
children: [
Text(
S
.of(context)
.unavailable_balance,
S.of(context).frozen_balance,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
@ -247,14 +229,6 @@ class BalanceRowWidget extends StatelessWidget {
height: 1,
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Icon(Icons.help_outline,
size: 16,
color: Theme.of(context)
.extension<BalancePageTheme>()!
.labelTextColor),
),
],
),
SizedBox(height: 8),
@ -286,11 +260,8 @@ class BalanceRowWidget extends StatelessWidget {
),
],
),
),
if (hasAdditionalBalance)
GestureDetector(
onTap: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
child: Column(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 24),
@ -301,8 +272,7 @@ class BalanceRowWidget extends StatelessWidget {
fontSize: 12,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context).extension<BalancePageTheme>()!
.labelTextColor,
color: Theme.of(context).extension<BalancePageTheme>()!.labelTextColor,
height: 1,
),
),
@ -313,8 +283,7 @@ class BalanceRowWidget extends StatelessWidget {
fontSize: 20,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context).extension<BalancePageTheme>()!
.assetTitleColor,
color: Theme.of(context).extension<BalancePageTheme>()!.assetTitleColor,
height: 1,
),
maxLines: 1,
@ -335,7 +304,6 @@ class BalanceRowWidget extends StatelessWidget {
),
],
),
),
],
),
),
@ -353,12 +321,20 @@ class BalanceRowWidget extends StatelessWidget {
),
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
),
child: Container(
child: TextButton(
onPressed: () => Fluttertoast.showToast(
msg: S.current.show_balance_toast,
backgroundColor: Color.fromRGBO(0, 0, 0, 0.85),
),
onLongPress: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: const EdgeInsets.only(top: 16, left: 24, right: 8, bottom: 16),
margin: const EdgeInsets.only(top: 10, left: 12, right: 12, bottom: 10),
child: Stack(
children: [
if (currency == CryptoCurrency.ltc)
@ -366,7 +342,6 @@ class BalanceRowWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
padding: EdgeInsets.only(right: 16, top: 0),
child: Column(
children: [
Container(
@ -397,19 +372,16 @@ class BalanceRowWidget extends StatelessWidget {
],
),
if (hasSecondAvailableBalance)
GestureDetector(
onTap: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
child: Row(
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () =>
launchUrl(
onTap: () => launchUrl(
Uri.parse(
"https://docs.cakewallet.com/cryptos/litecoin.html#mweb"),
"https://docs.cakewallet.com/cryptos/litecoin#mweb"),
mode: LaunchMode.externalApplication,
),
child: Row(
@ -472,7 +444,6 @@ class BalanceRowWidget extends StatelessWidget {
),
],
),
),
],
),
),
@ -539,15 +510,13 @@ class BalanceRowWidget extends StatelessWidget {
),
IntrinsicHeight(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 24),
padding: EdgeInsets.symmetric(horizontal: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Semantics(
label: S
.of(context)
.litecoin_mweb_pegin,
label: S.of(context).litecoin_mweb_pegin,
child: OutlinedButton(
onPressed: () {
final mwebAddress =
@ -589,9 +558,7 @@ class BalanceRowWidget extends StatelessWidget {
),
const SizedBox(width: 8),
Text(
S
.of(context)
.litecoin_mweb_pegin,
S.of(context).litecoin_mweb_pegin,
style: TextStyle(
color: Theme.of(context)
.extension<BalancePageTheme>()!
@ -607,9 +574,7 @@ class BalanceRowWidget extends StatelessWidget {
SizedBox(width: 24),
Expanded(
child: Semantics(
label: S
.of(context)
.litecoin_mweb_pegout,
label: S.of(context).litecoin_mweb_pegout,
child: OutlinedButton(
onPressed: () {
final litecoinAddress =
@ -651,9 +616,7 @@ class BalanceRowWidget extends StatelessWidget {
),
const SizedBox(width: 8),
Text(
S
.of(context)
.litecoin_mweb_pegout,
S.of(context).litecoin_mweb_pegout,
style: TextStyle(
color: Theme.of(context)
.extension<BalancePageTheme>()!

View file

@ -218,13 +218,13 @@ abstract class BalanceViewModelBase with Store {
availableBalance: '●●●●●●',
additionalBalance: additionalBalance,
frozenBalance: '',
secondAvailableBalance: '',
secondAdditionalBalance: '',
fiatAdditionalBalance: isFiatDisabled ? '' : '',
secondAvailableBalance: '●●●●●●',
secondAdditionalBalance: '●●●●●●',
fiatAdditionalBalance: isFiatDisabled ? '' : '${fiatCurrency.toString()} ●●●●●',
fiatAvailableBalance: isFiatDisabled ? '' : '${fiatCurrency.toString()} ●●●●●',
fiatFrozenBalance: isFiatDisabled ? '' : '',
fiatSecondAvailableBalance: isFiatDisabled ? '' : '',
fiatSecondAdditionalBalance: isFiatDisabled ? '' : '',
fiatSecondAvailableBalance: isFiatDisabled ? '' : '${fiatCurrency.toString()} ●●●●●',
fiatSecondAdditionalBalance: isFiatDisabled ? '' : '${fiatCurrency.toString()} ●●●●●',
asset: key,
formattedAssetTitle: _formatterAsset(key)));
}