Skip to content

Commit

Permalink
feat: Display synthetic USD in the overall wallet balance.
Browse files Browse the repository at this point in the history
Synthetic USD are shown in the overall balance (if we have any).

This is just a suggestion, probably iterating this with the community would be best.
  • Loading branch information
klochowicz committed Aug 29, 2023
1 parent f94f3c6 commit 17531d4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add settings in coordinator to make contract fee rate configurable during runtime.
- Fix: the status bar on iOS is always shown


## [1.2.2] - 2023-08-22

## [1.2.1] - 2023-08-21
Expand Down
39 changes: 32 additions & 7 deletions mobile/lib/features/wallet/wallet_screen.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:get_10101/common/amount_text.dart';
import 'package:get_10101/common/fiat_text.dart';
import 'package:get_10101/common/submission_status_dialog.dart';
import 'package:get_10101/common/value_data_row.dart';
import 'package:get_10101/features/trade/position_change_notifier.dart';
import 'package:get_10101/features/wallet/seed_screen.dart';
import 'package:get_10101/features/wallet/send_payment_change_notifier.dart';
import 'package:get_10101/util/preferences.dart';
Expand Down Expand Up @@ -39,9 +41,11 @@ class _WalletScreenState extends State<WalletScreen> {

@override
Widget build(BuildContext context) {
WalletChangeNotifier walletChangeNotifier = context.watch<WalletChangeNotifier>();
SendPaymentChangeNotifier sendPaymentChangeNotifier =
context.watch<SendPaymentChangeNotifier>();
final walletChangeNotifier = context.watch<WalletChangeNotifier>();
final sendPaymentChangeNotifier = context.watch<SendPaymentChangeNotifier>();

// For displaying synthetic USD balance
final positionChangeNotifier = context.watch<PositionChangeNotifier>();

if (sendPaymentChangeNotifier.pendingPayment != null &&
!sendPaymentChangeNotifier.pendingPayment!.displayed) {
Expand Down Expand Up @@ -138,10 +142,31 @@ class _WalletScreenState extends State<WalletScreen> {
fontStyle: FontStyle.italic,
),
)
: AmountText(
amount: walletChangeNotifier.total(),
textStyle: const TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold))),
: Row(
children: [
AmountText(
amount: walletChangeNotifier.total(),
textStyle: const TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
Visibility(
visible:
positionChangeNotifier.getStableUSDAmountInFiat() !=
0.0,
child: Row(
children: [
const SizedBox(width: 5),
const Text("+"),
const SizedBox(width: 5),
FiatText(
amount: positionChangeNotifier
.getStableUSDAmountInFiat(),
textStyle: const TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold)),
],
)),
],
)),
],
);
},
Expand Down

0 comments on commit 17531d4

Please sign in to comment.