diff --git a/lib/pages/wallet_view/sub_widgets/wallet_summary.dart b/lib/pages/wallet_view/sub_widgets/wallet_summary.dart index f1cb45ba6..99e244d5e 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary.dart @@ -49,10 +49,8 @@ class WalletSummary extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final bool hasCardImageBg = - ref.watch(managerProvider.select((value) => value.coin)) != null; - final Coin coin = ref.watch(managerProvider.select((value) => value.coin)); + final bool hasCardImageBg = ref.watch(coinCardProvider(coin)) != null; return AspectRatio( aspectRatio: aspectRatio, diff --git a/lib/pages/wallets_view/sub_widgets/favorite_card.dart b/lib/pages/wallets_view/sub_widgets/favorite_card.dart index c43fd2b3a..d2790d812 100644 --- a/lib/pages/wallets_view/sub_widgets/favorite_card.dart +++ b/lib/pages/wallets_view/sub_widgets/favorite_card.dart @@ -17,6 +17,7 @@ import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; +import 'package:stackwallet/themes/coin_card_provider.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; @@ -67,6 +68,8 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> { prefsChangeNotifierProvider.select((value) => value.externalCalls), ); + final bool hasCardImageBg = ref.watch(coinCardProvider(coin)) != null; + return ConditionalParent( condition: Util.isDesktop, builder: (child) => MouseRegion( @@ -147,63 +150,74 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> { child: CardOverlayStack( background: Stack( children: [ - Container( - width: widget.width, - height: widget.height, - decoration: BoxDecoration( - color: Theme.of(context) - .extension<StackColors>()! - .colorForCoin(coin), - borderRadius: BorderRadius.circular( - Constants.size.circularBorderRadius, + if (hasCardImageBg) + SvgPicture.file( + File( + ref.watch(coinCardProvider(coin))!, + ), + height: 24, + width: 24, + ), + if (!hasCardImageBg) + Container( + width: widget.width, + height: widget.height, + decoration: BoxDecoration( + color: Theme.of(context) + .extension<StackColors>()! + .colorForCoin(coin), + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), ), ), - ), - Column( - children: [ - const Spacer(), - SizedBox( - height: widget.width * 0.3, - child: Row( - children: [ - const Spacer( - flex: 9, - ), - SvgPicture.asset( - Assets.svg.ellipse2, - height: widget.width * 0.3, - ), - // ), - const Spacer( - flex: 2, - ), - ], + if (!hasCardImageBg) + Column( + children: [ + const Spacer(), + SizedBox( + height: widget.width * 0.3, + child: Row( + children: [ + const Spacer( + flex: 9, + ), + SvgPicture.asset( + Assets.svg.ellipse2, + height: widget.width * 0.3, + ), + // ), + const Spacer( + flex: 2, + ), + ], + ), ), - ), - ], - ), - Row( - children: [ - const Spacer( - flex: 5, - ), - SizedBox( - width: widget.width * 0.45, - child: Column( - children: [ - SvgPicture.asset( - Assets.svg.ellipse1, - width: widget.width * 0.45, - ), - const Spacer(), - ], + ], + ), + if (!hasCardImageBg) + Row( + children: [ + const Spacer( + flex: 5, ), - ), - const Spacer( - flex: 1, - ), - ], - ), + SizedBox( + width: widget.width * 0.45, + child: Column( + children: [ + SvgPicture.asset( + Assets.svg.ellipse1, + width: widget.width * 0.45, + ), + const Spacer(), + ], + ), + ), + const Spacer( + flex: 1, + ), + ], + ), ], ), child: Padding(