CW-260 show amount received for each account (#907)

* Show amount received for each account

* Enable litcoin send all

* disable litcoin send all

* Indent code

* Fix large font resolution for account title
This commit is contained in:
Godwin Asuquo
2023-05-05 15:58:41 +03:00
committed by GitHub
parent 25b743df47
commit 9714961298
8 changed files with 84 additions and 45 deletions
@@ -1,10 +1,9 @@
import 'package:flutter/foundation.dart';
class AccountListItem {
AccountListItem(
{required this.label, required this.id, this.isSelected = false});
{required this.label, required this.id, this.balance, this.isSelected = false});
final String label;
final int id;
final bool isSelected;
final String? balance;
}
@@ -1,3 +1,4 @@
import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:mobx/mobx.dart';
import 'package:cw_core/wallet_base.dart';
@@ -21,6 +22,8 @@ abstract class MoneroAccountListViewModelBase with Store {
this.scrollOffsetFromTop = scrollOffsetFromTop;
}
CryptoCurrency get currency => _wallet.currency;
@computed
List<AccountListItem> get accounts {
if (_wallet.type == WalletType.haven) {
@@ -39,6 +42,7 @@ abstract class MoneroAccountListViewModelBase with Store {
.accounts.map((acc) => AccountListItem(
label: acc.label,
id: acc.id,
balance: acc.balance,
isSelected: acc.id == monero!.getCurrentAccount(_wallet).id))
.toList();
}
@@ -53,7 +57,9 @@ abstract class MoneroAccountListViewModelBase with Store {
monero!.setCurrentAccount(
_wallet,
item.id,
item.label);
item.label,
item.balance,
);
}
if (_wallet.type == WalletType.haven) {