mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-28 11:34:52 +01:00
Hide available balance in send card (#2662)
* hide available balance on send page when balance is hidden * hide available balance on send page when balance is hidden * allow show/hide of balance from send card
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:cake_wallet/core/open_crypto_pay/open_cryptopay_service.dart';
|
||||
import 'package:cake_wallet/entities/balance_display_mode.dart';
|
||||
import 'package:cake_wallet/entities/priority_for_wallet_type.dart';
|
||||
import 'package:cake_wallet/src/screens/receive/widgets/currency_input_field.dart';
|
||||
import 'package:cake_wallet/src/widgets/bottom_sheet/payment_confirmation_bottom_sheet.dart';
|
||||
@@ -536,13 +537,36 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
|
||||
FutureBuilder<String>(
|
||||
future: sendViewModel.sendingBalance,
|
||||
builder: (context, snapshot) {
|
||||
return Text(
|
||||
snapshot.data ??
|
||||
sendViewModel.balance, // default to balance while loading
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
sendViewModel.balanceViewModel
|
||||
.switchBalanceValue();
|
||||
},
|
||||
child: Observer(builder: (_) {
|
||||
final hidden = sendViewModel
|
||||
.balanceViewModel.displayMode ==
|
||||
BalanceDisplayMode.hiddenBalance;
|
||||
return Text(
|
||||
hidden
|
||||
? S.of(context).show_balance_send_page
|
||||
: (snapshot.data ??
|
||||
sendViewModel.balance),
|
||||
// default to balance while loading
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall!
|
||||
.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: hidden
|
||||
? Theme.of(context)
|
||||
.colorScheme
|
||||
.primary
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurfaceVariant,
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user