From 71992ea0c82e03add5ad48e22f73b8e8612f6414 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 9 May 2023 17:59:26 -0600 Subject: [PATCH] fix: use SvgPicture.file constructors for themed assets located in the filesystem --- .../sub_widgets/coin_select_item.dart | 10 ++- .../sub_widgets/crypto_selection_view.dart | 10 ++- lib/pages/exchange_view/send_from_view.dart | 11 ++-- lib/pages/home_view/home_view.dart | 57 ++++++++++------- lib/pages/intro_view.dart | 22 ++++--- .../receive_view/addresses/address_card.dart | 9 ++- .../send_view/confirm_transaction_view.dart | 11 ++-- lib/pages/send_view/send_view.dart | 11 ++-- .../manage_nodes_views/coin_nodes_view.dart | 10 ++- .../manage_nodes_views/manage_nodes_view.dart | 12 ++-- .../wallet_view/sub_widgets/tx_icon.dart | 41 ++++++++----- .../sub_widgets/wallet_summary_info.dart | 9 ++- lib/pages/wallet_view/wallet_view.dart | 61 ++++++++++++------- .../sub_widgets/empty_wallets.dart | 12 ++-- .../sub_widgets/favorite_card.dart | 10 ++- .../sub_widgets/wallet_list_item.dart | 9 ++- .../wallet_view/desktop_wallet_view.dart | 15 +++-- .../sub_widgets/desktop_wallet_features.dart | 7 ++- 18 files changed, 215 insertions(+), 112 deletions(-) diff --git a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart index 4d4f8ec19..7e85337c4 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -8,8 +10,8 @@ import 'package:stackwallet/models/isar/exchange_cache/currency.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart'; import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -76,8 +78,10 @@ class CoinSelectItem extends ConsumerWidget { width: 26, height: 26, ) - : SvgPicture.asset( - ref.watch(coinIconProvider(entity.coin)), + : SvgPicture.file( + File( + ref.watch(coinIconProvider(entity.coin)), + ), width: 26, height: 26, ), diff --git a/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart b/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart index 15285bb8d..7ee9b296b 100644 --- a/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart +++ b/lib/pages/buy_view/sub_widgets/crypto_selection_view.dart @@ -1,9 +1,11 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/buy/response_objects/crypto.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -289,8 +291,10 @@ class CoinIconForTicker extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { try { final coin = coinFromTickerCaseInsensitive(ticker); - return SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + return SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: size, height: size, ); diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index a12eb0e89..28164e850 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -12,8 +13,8 @@ import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/coins/manager.dart'; -import 'package:stackwallet/themes/stack_colors.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/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -575,9 +576,11 @@ class _SendFromCardState extends ConsumerState { ), child: Padding( padding: const EdgeInsets.all(6), - child: SvgPicture.asset( - ref.watch( - coinIconProvider(coin), + child: SvgPicture.file( + File( + ref.watch( + coinIconProvider(coin), + ), ), width: 24, height: 24, diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index 5ec5367e9..c9cf5f478 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -163,10 +164,12 @@ class _HomeViewState extends ConsumerState { GestureDetector( onTap: _hiddenOptions, child: RotateIcon( - icon: SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stackIcon, + icon: SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stackIcon, + ), ), ), width: 24, @@ -204,24 +207,36 @@ class _HomeViewState extends ConsumerState { color: Theme.of(context) .extension()! .backgroundAppBar, - icon: SvgPicture.asset( - ref.watch(notificationsProvider - .select((value) => value.hasUnreadNotifications)) - ? ref.watch( - themeProvider.select( - (value) => value.assets.bellNew, + icon: ref.watch(notificationsProvider + .select((value) => value.hasUnreadNotifications)) + ? SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.bellNew, + ), ), - ) - : Assets.svg.bell, - width: 20, - height: 20, - color: ref.watch(notificationsProvider - .select((value) => value.hasUnreadNotifications)) - ? null - : Theme.of(context) - .extension()! - .topNavIconPrimary, - ), + ), + width: 20, + height: 20, + color: ref.watch(notificationsProvider.select( + (value) => value.hasUnreadNotifications)) + ? null + : Theme.of(context) + .extension()! + .topNavIconPrimary, + ) + : SvgPicture.asset( + Assets.svg.bell, + width: 20, + height: 20, + color: ref.watch(notificationsProvider.select( + (value) => value.hasUnreadNotifications)) + ? null + : Theme.of(context) + .extension()! + .topNavIconPrimary, + ), onPressed: () { // reset unread state ref.refresh(unreadNotificationsStateProvider); diff --git a/lib/pages/intro_view.dart b/lib/pages/intro_view.dart index ecfbe89ac..5771f4bca 100644 --- a/lib/pages/intro_view.dart +++ b/lib/pages/intro_view.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -53,10 +55,12 @@ class _IntroViewState extends ConsumerState { constraints: const BoxConstraints( maxWidth: 300, ), - child: SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stack, + child: SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stack, + ), ), ), width: isDesktop ? 324 : 266, @@ -120,10 +124,12 @@ class _IntroViewState extends ConsumerState { SizedBox( width: 130, height: 130, - child: SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stackIcon, + child: SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stackIcon, + ), ), ), ), diff --git a/lib/pages/receive_view/addresses/address_card.dart b/lib/pages/receive_view/addresses/address_card.dart index ed0d020f4..6a8abd78d 100644 --- a/lib/pages/receive_view/addresses/address_card.dart +++ b/lib/pages/receive_view/addresses/address_card.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -86,9 +87,11 @@ class _AddressCardState extends ConsumerState { builder: (child) => Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset( - ref.watch( - coinIconProvider(widget.coin), + SvgPicture.file( + File( + ref.watch( + coinIconProvider(widget.coin), + ), ), width: 32, height: 32, diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index 79160b90a..e07064d39 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; @@ -514,10 +515,12 @@ class _ConfirmTransactionViewState ), child: Row( children: [ - SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.send, + SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.send, + ), ), ), width: 32, diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index bb1ffbd6a..3d98309be 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:bip47/bip47.dart'; import 'package:cw_core/monero_transaction_priority.dart'; @@ -24,8 +25,8 @@ import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/assets.dart'; @@ -758,9 +759,11 @@ class _SendViewState extends ConsumerState { padding: const EdgeInsets.all(12.0), child: Row( children: [ - SvgPicture.asset( - ref.watch( - coinIconProvider(coin), + SvgPicture.file( + File( + ref.watch( + coinIconProvider(coin), + ), ), width: 22, height: 22, diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart index 8f41b9015..03fc37f4f 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -54,9 +56,11 @@ class _CoinNodesViewState extends ConsumerState { const SizedBox( width: 32, ), - SvgPicture.asset( - ref.watch( - coinIconProvider(widget.coin), + SvgPicture.file( + File( + ref.watch( + coinIconProvider(widget.coin), + ), ), width: 24, height: 24, diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart index 2f529a495..7caf4647f 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart @@ -1,10 +1,12 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -102,9 +104,11 @@ class _ManageNodesViewState extends ConsumerState { padding: const EdgeInsets.all(12), child: Row( children: [ - SvgPicture.asset( - ref.watch( - coinIconProvider(coin), + SvgPicture.file( + File( + ref.watch( + coinIconProvider(coin), + ), ), width: 24, height: 24, diff --git a/lib/pages/wallet_view/sub_widgets/tx_icon.dart b/lib/pages/wallet_view/sub_widgets/tx_icon.dart index 42be20e81..74c179b47 100644 --- a/lib/pages/wallet_view/sub_widgets/tx_icon.dart +++ b/lib/pages/wallet_view/sub_widgets/tx_icon.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/cupertino.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -69,24 +71,35 @@ class TxIcon extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final txIsReceived = transaction.type == TransactionType.incoming; + final assetName = _getAssetName( + transaction.isCancelled, + txIsReceived, + !transaction.isConfirmed( + currentHeight, + coin.requiredConfirmations, + ), + ref.watch(themeProvider).assets, + ); + return SizedBox( width: size.width, height: size.height, child: Center( - child: SvgPicture.asset( - _getAssetName( - transaction.isCancelled, - txIsReceived, - !transaction.isConfirmed( - currentHeight, - coin.requiredConfirmations, - ), - ref.watch(themeProvider).assets, - ), - width: size.width, - height: size.height, - ), - ), + // if it starts with "assets" we assume its local + // TODO: a more thorough check + child: assetName.startsWith("assets") + ? SvgPicture.asset( + assetName, + width: size.width, + height: size.height, + ) + : SvgPicture.file( + File( + assetName, + ), + width: size.width, + height: size.height, + )), ); } } diff --git a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart index 2672df825..32db97f81 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -12,8 +13,8 @@ import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/event_bus/events/global/balance_refreshed_event.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/global_event_bus.dart'; -import 'package:stackwallet/themes/stack_colors.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/assets.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -178,8 +179,10 @@ class _WalletSummaryInfoState extends ConsumerState { ), Column( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 24, height: 24, ), diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 89038f14a..ea4804a8a 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; @@ -37,8 +38,8 @@ import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_ import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart'; import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/assets.dart'; @@ -471,8 +472,10 @@ class _WalletViewState extends ConsumerState { titleSpacing: 0, title: Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 24, height: 24, ), @@ -538,25 +541,41 @@ class _WalletViewState extends ConsumerState { color: Theme.of(context) .extension()! .background, - icon: SvgPicture.asset( - ref.watch(notificationsProvider.select((value) => - value.hasUnreadNotificationsFor(walletId))) - ? ref.watch( - themeProvider.select( - (value) => value.assets.bellNew, + icon: ref.watch(notificationsProvider.select( + (value) => value + .hasUnreadNotificationsFor(walletId))) + ? SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.bellNew, + ), ), - ) - : Assets.svg.bell, - width: 20, - height: 20, - color: ref.watch(notificationsProvider.select( - (value) => value - .hasUnreadNotificationsFor(walletId))) - ? null - : Theme.of(context) - .extension()! - .topNavIconPrimary, - ), + ), + width: 20, + height: 20, + color: ref.watch(notificationsProvider.select( + (value) => + value.hasUnreadNotificationsFor( + walletId))) + ? null + : Theme.of(context) + .extension()! + .topNavIconPrimary, + ) + : SvgPicture.asset( + Assets.svg.bell, + width: 20, + height: 20, + color: ref.watch(notificationsProvider.select( + (value) => + value.hasUnreadNotificationsFor( + walletId))) + ? null + : Theme.of(context) + .extension()! + .topNavIconPrimary, + ), onPressed: () { // reset unread state ref.refresh(unreadNotificationsStateProvider); diff --git a/lib/pages/wallets_view/sub_widgets/empty_wallets.dart b/lib/pages/wallets_view/sub_widgets/empty_wallets.dart index e07588a35..23d4686e7 100644 --- a/lib/pages/wallets_view/sub_widgets/empty_wallets.dart +++ b/lib/pages/wallets_view/sub_widgets/empty_wallets.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -31,10 +33,12 @@ class EmptyWallets extends ConsumerWidget { const Spacer( flex: 2, ), - SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stack, + SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stack, + ), ), ), width: isDesktop ? 324 : MediaQuery.of(context).size.width / 3, diff --git a/lib/pages/wallets_view/sub_widgets/favorite_card.dart b/lib/pages/wallets_view/sub_widgets/favorite_card.dart index 8d9b08da9..87ffbccd1 100644 --- a/lib/pages/wallets_view/sub_widgets/favorite_card.dart +++ b/lib/pages/wallets_view/sub_widgets/favorite_card.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -5,8 +7,8 @@ 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/manager.dart'; -import 'package:stackwallet/themes/stack_colors.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/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; @@ -213,8 +215,10 @@ class _FavoriteCardState extends ConsumerState { overflow: TextOverflow.fade, ), ), - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 24, height: 24, ), diff --git a/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart b/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart index b851835cd..81194fdc3 100644 --- a/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart +++ b/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -6,8 +7,8 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; import 'package:stackwallet/pages/wallets_view/wallets_overview.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/themes/stack_colors.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'; @@ -79,8 +80,10 @@ class WalletListItem extends ConsumerWidget { }, child: Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 28, height: 28, ), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart index 29479c69b..59fe4acf9 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; @@ -19,8 +20,8 @@ import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/transaction_filter_provider.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/global_event_bus.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/coin_icon_provider.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart'; @@ -265,8 +266,10 @@ class _DesktopWalletViewState extends ConsumerState { const SizedBox( width: 15, ), - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 32, height: 32, ), @@ -321,8 +324,10 @@ class _DesktopWalletViewState extends ConsumerState { padding: const EdgeInsets.all(20), child: Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 40, height: 40, ), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart index e9a3c4e7e..f118a88e2 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_wallet_features.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -347,8 +348,10 @@ class _DesktopWalletFeaturesState extends ConsumerState { label: "Buy", width: buttonWidth, buttonHeight: ButtonHeight.l, - icon: SvgPicture.asset( - ref.watch(themeProvider.select((value) => value.assets.buy)), + icon: SvgPicture.file( + File( + ref.watch(themeProvider.select((value) => value.assets.buy)), + ), height: 20, width: 20, color: Theme.of(context)