mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
fix: Firo total displayed on managed favourite list card
This commit is contained in:
parent
3189203419
commit
6a92657f50
1 changed files with 26 additions and 2 deletions
|
@ -4,8 +4,10 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||
import 'package:stackwallet/themes/coin_icon_provider.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
|
@ -34,6 +36,28 @@ class _ManagedFavoriteCardState extends ConsumerState<ManagedFavorite> {
|
|||
|
||||
final isDesktop = Util.isDesktop;
|
||||
|
||||
final balance = ref.watch(
|
||||
walletsChangeNotifierProvider.select(
|
||||
(value) => value.getManager(widget.walletId).balance,
|
||||
),
|
||||
);
|
||||
|
||||
Amount total = balance.total;
|
||||
if (manager.coin == Coin.firo || manager.coin == Coin.firoTestNet) {
|
||||
final balancePrivate = ref.watch(
|
||||
walletsChangeNotifierProvider.select(
|
||||
(value) => (value
|
||||
.getManager(
|
||||
widget.walletId,
|
||||
)
|
||||
.wallet as FiroWallet)
|
||||
.balancePrivate,
|
||||
),
|
||||
);
|
||||
|
||||
total += balancePrivate.total;
|
||||
}
|
||||
|
||||
return RoundedWhiteContainer(
|
||||
padding: EdgeInsets.all(isDesktop ? 0 : 4.0),
|
||||
child: RawMaterialButton(
|
||||
|
@ -107,7 +131,7 @@ class _ManagedFavoriteCardState extends ConsumerState<ManagedFavorite> {
|
|||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${manager.balance.total.localizedStringAsFixed(
|
||||
"${total.localizedStringAsFixed(
|
||||
locale: ref.watch(
|
||||
localeServiceChangeNotifierProvider.select(
|
||||
(value) => value.locale,
|
||||
|
@ -150,7 +174,7 @@ class _ManagedFavoriteCardState extends ConsumerState<ManagedFavorite> {
|
|||
height: 2,
|
||||
),
|
||||
Text(
|
||||
"${manager.balance.total.localizedStringAsFixed(
|
||||
"${total.localizedStringAsFixed(
|
||||
locale: ref.watch(
|
||||
localeServiceChangeNotifierProvider.select(
|
||||
(value) => value.locale,
|
||||
|
|
Loading…
Reference in a new issue