mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
fix token balance showing 0 on wallet info row
This commit is contained in:
parent
9321480b8d
commit
e1a2cf85f3
2 changed files with 9 additions and 11 deletions
|
@ -12,14 +12,13 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:stackwallet/db/isar/main_db.dart';
|
||||
import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount_formatter.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/wallets/isar/providers/eth/token_balance_provider.dart';
|
||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/ethereum_wallet.dart';
|
||||
|
||||
class WalletInfoRowBalance extends ConsumerWidget {
|
||||
const WalletInfoRowBalance({
|
||||
|
@ -44,12 +43,11 @@ class WalletInfoRowBalance extends ConsumerWidget {
|
|||
|
||||
contract = null;
|
||||
} else {
|
||||
final ethWallet =
|
||||
ref.watch(pWallets).getWallet(walletId) as EthereumWallet;
|
||||
contract = MainDB.instance.getEthContractSync(contractAddress!)!;
|
||||
//TODO: [prio=high] fix this for token service/interface
|
||||
// totalBalance = ethWallet.getCachedTokenBalance(contract).total;
|
||||
totalBalance = Amount.zero;
|
||||
totalBalance = ref
|
||||
.watch(pTokenBalance(
|
||||
(contractAddress: contractAddress!, walletId: walletId)))
|
||||
.total;
|
||||
}
|
||||
|
||||
return Text(
|
||||
|
|
Loading…
Reference in a new issue