Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions lib/pages/cakepay/cakepay_send_from_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import '../../widgets/conditional_parent.dart';
import '../../widgets/custom_buttons/app_bar_icon_button.dart';
import '../../widgets/desktop/desktop_dialog.dart';
import '../../widgets/desktop/desktop_dialog_close_button.dart';
import '../../widgets/hideable_balance.dart';
import '../../widgets/rounded_white_container.dart';
import '../../widgets/stack_dialog.dart';
import '../../pages_desktop_specific/desktop_home_view.dart';
Expand Down Expand Up @@ -80,9 +81,9 @@ class _CakePaySendFromViewState extends ConsumerState<CakePaySendFromView> {
builder: (child) {
return Background(
child: Scaffold(
backgroundColor: Theme.of(
context,
).extension<StackColors>()!.background,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () => Navigator.of(context).pop(),
Expand Down Expand Up @@ -208,9 +209,9 @@ class _CakePaySendFromCardState extends ConsumerState<_CakePaySendFromCard> {
child: Text(
"Ok",
style: STextStyles.button(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.buttonTextSecondary,
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
onPressed: () => Navigator.of(context).pop(),
Expand Down Expand Up @@ -327,9 +328,9 @@ class _CakePaySendFromCardState extends ConsumerState<_CakePaySendFromCard> {
child: Text(
"Ok",
style: STextStyles.button(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.buttonTextSecondary,
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
onPressed: () => Navigator.of(context).pop(),
Expand Down Expand Up @@ -389,13 +390,21 @@ class _CakePaySendFromCardState extends ConsumerState<_CakePaySendFromCard> {
style: STextStyles.titleBold12(context),
),
const SizedBox(height: 2),
Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref.watch(pWalletBalance(widget.walletId)).spendable,
),
style: STextStyles.itemSubtitle(context),
HideableBalance(
iconColor: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
iconSize: 16,
child: Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref
.watch(pWalletBalance(widget.walletId))
.spendable,
),
style: STextStyles.itemSubtitle(context),
),
),
],
),
Expand Down
11 changes: 7 additions & 4 deletions lib/pages/exchange_view/exchange_step_views/step_4_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class _Step4ViewState extends ConsumerState<Step4View> {
final coin = ref.read(pWalletCoin(walletId));
final balancePublic = ref.read(pWalletBalance(walletId));
final balancePrivate = ref.read(pWalletBalanceTertiary(walletId));
final hideBalances = ref.read(hideBalancesProvider);

return await showModalBottomSheet<bool?>(
context: context,
Expand All @@ -217,14 +218,16 @@ class _Step4ViewState extends ConsumerState<Step4View> {
),
const SizedBox(height: 32),
SecondaryButton(
label:
"${ref.watch(pAmountFormatter(coin)).format(balancePrivate.spendable)} (private)",
label: hideBalances
? "Private balance"
: "${ref.watch(pAmountFormatter(coin)).format(balancePrivate.spendable)} (private)",
onPressed: () => Navigator.of(context).pop(false),
),
const SizedBox(height: 16),
SecondaryButton(
label:
"${ref.watch(pAmountFormatter(coin)).format(balancePublic.spendable)} (public)",
label: hideBalances
? "Public balance"
: "${ref.watch(pAmountFormatter(coin)).format(balancePublic.spendable)} (public)",
onPressed: () => Navigator.of(context).pop(true),
),
const SizedBox(height: 32),
Expand Down
109 changes: 64 additions & 45 deletions lib/pages/exchange_view/send_from_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import '../../widgets/custom_buttons/app_bar_icon_button.dart';
import '../../widgets/desktop/desktop_dialog.dart';
import '../../widgets/desktop/desktop_dialog_close_button.dart';
import '../../widgets/expandable.dart';
import '../../widgets/hideable_balance.dart';
import '../../widgets/rounded_white_container.dart';
import '../../widgets/stack_dialog.dart';
import '../home_view/home_view.dart';
Expand Down Expand Up @@ -106,9 +107,9 @@ class _SendFromViewState extends ConsumerState<SendFromView> {
builder: (child) {
return Background(
child: Scaffold(
backgroundColor: Theme.of(
context,
).extension<StackColors>()!.background,
backgroundColor: Theme.of(context)
.extension<StackColors>()!
.background,
appBar: AppBar(
leading: AppBarBackButton(
onPressed: () {
Expand Down Expand Up @@ -381,9 +382,9 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
child: Text(
"Ok",
style: STextStyles.button(context).copyWith(
color: Theme.of(
context,
).extension<StackColors>()!.buttonTextSecondary,
color: Theme.of(context)
.extension<StackColors>()!
.buttonTextSecondary,
),
),
onPressed: () {
Expand Down Expand Up @@ -427,9 +428,9 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
children: [
if (!trade.exchangeName.startsWith(TrocadorExchange.exchangeName))
MaterialButton(
splashColor: Theme.of(
context,
).extension<StackColors>()!.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
key: Key("walletsSheetItemButtonFiroPrivateKey_$walletId"),
padding: const EdgeInsets.all(0),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
Expand Down Expand Up @@ -463,37 +464,43 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
"Use private balance",
style: STextStyles.itemSubtitle(context),
),
Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref
.watch(
pWalletBalanceTertiary(walletId),
)
.spendable,
),
style: STextStyles.itemSubtitle(context),
HideableBalance(
iconColor: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
iconSize: 16,
child: Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref
.watch(
pWalletBalanceTertiary(walletId),
)
.spendable,
),
style: STextStyles.itemSubtitle(context),
),
),
],
),
SvgPicture.asset(
Assets.svg.chevronRight,
height: 14,
width: 7,
color: Theme.of(
context,
).extension<StackColors>()!.infoItemLabel,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
),
],
),
),
),
),
MaterialButton(
splashColor: Theme.of(
context,
).extension<StackColors>()!.highlight,
splashColor: Theme.of(context)
.extension<StackColors>()!
.highlight,
key: Key("walletsSheetItemButtonFiroPublicKey_$walletId"),
padding: const EdgeInsets.all(0),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
Expand Down Expand Up @@ -527,25 +534,31 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
"Use public balance",
style: STextStyles.itemSubtitle(context),
),
Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref
.watch(pWalletBalance(walletId))
.spendable,
),
style: STextStyles.itemSubtitle(context),
HideableBalance(
iconColor: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
iconSize: 16,
child: Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref
.watch(pWalletBalance(walletId))
.spendable,
),
style: STextStyles.itemSubtitle(context),
),
),
],
),
SvgPicture.asset(
Assets.svg.chevronRight,
height: 14,
width: 7,
color: Theme.of(
context,
).extension<StackColors>()!.infoItemLabel,
color: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
),
],
),
Expand Down Expand Up @@ -605,13 +618,19 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
),
if (!isFiro) const SizedBox(height: 2),
if (!isFiro)
Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref.watch(pWalletBalance(walletId)).spendable,
),
style: STextStyles.itemSubtitle(context),
HideableBalance(
iconColor: Theme.of(context)
.extension<StackColors>()!
.infoItemLabel,
iconSize: 16,
child: Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref.watch(pWalletBalance(walletId)).spendable,
),
style: STextStyles.itemSubtitle(context),
),
),
],
),
Expand Down
39 changes: 23 additions & 16 deletions lib/pages/send_view/frost_ms/frost_send_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import '../../../widgets/desktop/primary_button.dart';
import '../../../widgets/desktop/secondary_button.dart';
import '../../../widgets/fee_slider.dart';
import '../../../widgets/frost_scaffold.dart';
import '../../../widgets/hideable_balance.dart';
import '../../../widgets/icon_widgets/x_icon.dart';
import '../../../widgets/rounded_white_container.dart';
import '../../../widgets/stack_dialog.dart';
Expand Down Expand Up @@ -341,22 +342,28 @@ class _FrostSendViewState extends ConsumerState<FrostSendView> {
onTap: () {},
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref
.watch(pWalletBalance(walletId))
.spendable,
),
style: STextStyles.titleBold12(context)
.copyWith(fontSize: 10),
textAlign: TextAlign.right,
),
],
child: HideableBalance(
iconColor: Theme.of(context)
.extension<StackColors>()!
.textDark,
iconSize: 16,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
ref
.watch(pAmountFormatter(coin))
.format(
ref
.watch(pWalletBalance(walletId))
.spendable,
),
style: STextStyles.titleBold12(context)
.copyWith(fontSize: 10),
textAlign: TextAlign.right,
),
],
),
),
),
),
Expand Down
Loading
Loading