fix: use SvgPicture.file constructors for themed assets located in the filesystem

This commit is contained in:
julian 2023-05-09 17:59:26 -06:00
parent f8e6b060e6
commit 71992ea0c8
18 changed files with 215 additions and 112 deletions

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.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/providers/providers.dart';
import 'package:stackwallet/services/exchange/change_now/change_now_exchange.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/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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
@ -76,8 +78,10 @@ class CoinSelectItem extends ConsumerWidget {
width: 26, width: 26,
height: 26, height: 26,
) )
: SvgPicture.asset( : SvgPicture.file(
ref.watch(coinIconProvider(entity.coin)), File(
ref.watch(coinIconProvider(entity.coin)),
),
width: 26, width: 26,
height: 26, height: 26,
), ),

View file

@ -1,9 +1,11 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/models/buy/response_objects/crypto.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
@ -289,8 +291,10 @@ class CoinIconForTicker extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
try { try {
final coin = coinFromTickerCaseInsensitive(ticker); final coin = coinFromTickerCaseInsensitive(ticker);
return SvgPicture.asset( return SvgPicture.file(
ref.watch(coinIconProvider(coin)), File(
ref.watch(coinIconProvider(coin)),
),
width: size, width: size,
height: size, height: size,
); );

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.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/route_generator.dart';
import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
import 'package:stackwallet/services/coins/manager.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
@ -575,9 +576,11 @@ class _SendFromCardState extends ConsumerState<SendFromCard> {
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(6), padding: const EdgeInsets.all(6),
child: SvgPicture.asset( child: SvgPicture.file(
ref.watch( File(
coinIconProvider(coin), ref.watch(
coinIconProvider(coin),
),
), ),
width: 24, width: 24,
height: 24, height: 24,

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -163,10 +164,12 @@ class _HomeViewState extends ConsumerState<HomeView> {
GestureDetector( GestureDetector(
onTap: _hiddenOptions, onTap: _hiddenOptions,
child: RotateIcon( child: RotateIcon(
icon: SvgPicture.asset( icon: SvgPicture.file(
ref.watch( File(
themeProvider.select( ref.watch(
(value) => value.assets.stackIcon, themeProvider.select(
(value) => value.assets.stackIcon,
),
), ),
), ),
width: 24, width: 24,
@ -204,24 +207,36 @@ class _HomeViewState extends ConsumerState<HomeView> {
color: Theme.of(context) color: Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!
.backgroundAppBar, .backgroundAppBar,
icon: SvgPicture.asset( icon: ref.watch(notificationsProvider
ref.watch(notificationsProvider .select((value) => value.hasUnreadNotifications))
.select((value) => value.hasUnreadNotifications)) ? SvgPicture.file(
? ref.watch( File(
themeProvider.select( ref.watch(
(value) => value.assets.bellNew, themeProvider.select(
(value) => value.assets.bellNew,
),
), ),
) ),
: Assets.svg.bell, width: 20,
width: 20, height: 20,
height: 20, color: ref.watch(notificationsProvider.select(
color: ref.watch(notificationsProvider (value) => value.hasUnreadNotifications))
.select((value) => value.hasUnreadNotifications)) ? null
? null : Theme.of(context)
: Theme.of(context) .extension<StackColors>()!
.extension<StackColors>()! .topNavIconPrimary,
.topNavIconPrimary, )
), : SvgPicture.asset(
Assets.svg.bell,
width: 20,
height: 20,
color: ref.watch(notificationsProvider.select(
(value) => value.hasUnreadNotifications))
? null
: Theme.of(context)
.extension<StackColors>()!
.topNavIconPrimary,
),
onPressed: () { onPressed: () {
// reset unread state // reset unread state
ref.refresh(unreadNotificationsStateProvider); ref.refresh(unreadNotificationsStateProvider);

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -53,10 +55,12 @@ class _IntroViewState extends ConsumerState<IntroView> {
constraints: const BoxConstraints( constraints: const BoxConstraints(
maxWidth: 300, maxWidth: 300,
), ),
child: SvgPicture.asset( child: SvgPicture.file(
ref.watch( File(
themeProvider.select( ref.watch(
(value) => value.assets.stack, themeProvider.select(
(value) => value.assets.stack,
),
), ),
), ),
width: isDesktop ? 324 : 266, width: isDesktop ? 324 : 266,
@ -120,10 +124,12 @@ class _IntroViewState extends ConsumerState<IntroView> {
SizedBox( SizedBox(
width: 130, width: 130,
height: 130, height: 130,
child: SvgPicture.asset( child: SvgPicture.file(
ref.watch( File(
themeProvider.select( ref.watch(
(value) => value.assets.stackIcon, themeProvider.select(
(value) => value.assets.stackIcon,
),
), ),
), ),
), ),

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -86,9 +87,11 @@ class _AddressCardState extends ConsumerState<AddressCard> {
builder: (child) => Row( builder: (child) => Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch( File(
coinIconProvider(widget.coin), ref.watch(
coinIconProvider(widget.coin),
),
), ),
width: 32, width: 32,
height: 32, height: 32,

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:decimal/decimal.dart'; import 'package:decimal/decimal.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -514,10 +515,12 @@ class _ConfirmTransactionViewState
), ),
child: Row( child: Row(
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch( File(
themeProvider.select( ref.watch(
(value) => value.assets.send, themeProvider.select(
(value) => value.assets.send,
),
), ),
), ),
width: 32, width: 32,

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:bip47/bip47.dart'; import 'package:bip47/bip47.dart';
import 'package:cw_core/monero_transaction_priority.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/firo/firo_wallet.dart';
import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/services/coins/manager.dart';
import 'package:stackwallet/services/mixins/paynym_wallet_interface.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/address_utils.dart';
import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
@ -758,9 +759,11 @@ class _SendViewState extends ConsumerState<SendView> {
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Row( child: Row(
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch( File(
coinIconProvider(coin), ref.watch(
coinIconProvider(coin),
),
), ),
width: 22, width: 22,
height: 22, height: 22,

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
@ -54,9 +56,11 @@ class _CoinNodesViewState extends ConsumerState<CoinNodesView> {
const SizedBox( const SizedBox(
width: 32, width: 32,
), ),
SvgPicture.asset( SvgPicture.file(
ref.watch( File(
coinIconProvider(widget.coin), ref.watch(
coinIconProvider(widget.coin),
),
), ),
width: 24, width: 24,
height: 24, height: 24,

View file

@ -1,10 +1,12 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.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/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart';
import 'package:stackwallet/providers/providers.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
@ -102,9 +104,11 @@ class _ManageNodesViewState extends ConsumerState<ManageNodesView> {
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
child: Row( child: Row(
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch( File(
coinIconProvider(coin), ref.watch(
coinIconProvider(coin),
),
), ),
width: 24, width: 24,
height: 24, height: 24,

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
@ -69,24 +71,35 @@ class TxIcon extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
final txIsReceived = transaction.type == TransactionType.incoming; final txIsReceived = transaction.type == TransactionType.incoming;
final assetName = _getAssetName(
transaction.isCancelled,
txIsReceived,
!transaction.isConfirmed(
currentHeight,
coin.requiredConfirmations,
),
ref.watch(themeProvider).assets,
);
return SizedBox( return SizedBox(
width: size.width, width: size.width,
height: size.height, height: size.height,
child: Center( child: Center(
child: SvgPicture.asset( // if it starts with "assets" we assume its local
_getAssetName( // TODO: a more thorough check
transaction.isCancelled, child: assetName.startsWith("assets")
txIsReceived, ? SvgPicture.asset(
!transaction.isConfirmed( assetName,
currentHeight, width: size.width,
coin.requiredConfirmations, height: size.height,
), )
ref.watch(themeProvider).assets, : SvgPicture.file(
), File(
width: size.width, assetName,
height: size.height, ),
), width: size.width,
), height: size.height,
)),
); );
} }
} }

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.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/balance_refreshed_event.dart';
import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_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/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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
@ -178,8 +179,10 @@ class _WalletSummaryInfoState extends ConsumerState<WalletSummaryInfo> {
), ),
Column( Column(
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch(coinIconProvider(coin)), File(
ref.watch(coinIconProvider(coin)),
),
width: 24, width: 24,
height: 24, height: 24,
), ),

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:event_bus/event_bus.dart'; import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.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/event_bus/global_event_bus.dart';
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart'; import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
import 'package:stackwallet/services/mixins/paynym_wallet_interface.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/themes/theme_providers.dart';
import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
@ -471,8 +472,10 @@ class _WalletViewState extends ConsumerState<WalletView> {
titleSpacing: 0, titleSpacing: 0,
title: Row( title: Row(
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch(coinIconProvider(coin)), File(
ref.watch(coinIconProvider(coin)),
),
width: 24, width: 24,
height: 24, height: 24,
), ),
@ -538,25 +541,41 @@ class _WalletViewState extends ConsumerState<WalletView> {
color: Theme.of(context) color: Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!
.background, .background,
icon: SvgPicture.asset( icon: ref.watch(notificationsProvider.select(
ref.watch(notificationsProvider.select((value) => (value) => value
value.hasUnreadNotificationsFor(walletId))) .hasUnreadNotificationsFor(walletId)))
? ref.watch( ? SvgPicture.file(
themeProvider.select( File(
(value) => value.assets.bellNew, ref.watch(
themeProvider.select(
(value) => value.assets.bellNew,
),
), ),
) ),
: Assets.svg.bell, width: 20,
width: 20, height: 20,
height: 20, color: ref.watch(notificationsProvider.select(
color: ref.watch(notificationsProvider.select( (value) =>
(value) => value value.hasUnreadNotificationsFor(
.hasUnreadNotificationsFor(walletId))) walletId)))
? null ? null
: Theme.of(context) : Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!
.topNavIconPrimary, .topNavIconPrimary,
), )
: SvgPicture.asset(
Assets.svg.bell,
width: 20,
height: 20,
color: ref.watch(notificationsProvider.select(
(value) =>
value.hasUnreadNotificationsFor(
walletId)))
? null
: Theme.of(context)
.extension<StackColors>()!
.topNavIconPrimary,
),
onPressed: () { onPressed: () {
// reset unread state // reset unread state
ref.refresh(unreadNotificationsStateProvider); ref.refresh(unreadNotificationsStateProvider);

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
@ -31,10 +33,12 @@ class EmptyWallets extends ConsumerWidget {
const Spacer( const Spacer(
flex: 2, flex: 2,
), ),
SvgPicture.asset( SvgPicture.file(
ref.watch( File(
themeProvider.select( ref.watch(
(value) => value.assets.stack, themeProvider.select(
(value) => value.assets.stack,
),
), ),
), ),
width: isDesktop ? 324 : MediaQuery.of(context).size.width / 3, width: isDesktop ? 324 : MediaQuery.of(context).size.width / 3,

View file

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.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/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart';
import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/manager.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
@ -213,8 +215,10 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
), ),
), ),
SvgPicture.asset( SvgPicture.file(
ref.watch(coinIconProvider(coin)), File(
ref.watch(coinIconProvider(coin)),
),
width: 24, width: 24,
height: 24, height: 24,
), ),

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.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/wallet_view/wallet_view.dart';
import 'package:stackwallet/pages/wallets_view/wallets_overview.dart'; import 'package:stackwallet/pages/wallets_view/wallets_overview.dart';
import 'package:stackwallet/providers/providers.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/amount/amount.dart'; import 'package:stackwallet/utilities/amount/amount.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
@ -79,8 +80,10 @@ class WalletListItem extends ConsumerWidget {
}, },
child: Row( child: Row(
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch(coinIconProvider(coin)), File(
ref.watch(coinIconProvider(coin)),
),
width: 28, width: 28,
height: 28, height: 28,
), ),

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:event_bus/event_bus.dart'; import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.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/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/events/global/wallet_sync_status_changed_event.dart';
import 'package:stackwallet/services/event_bus/global_event_bus.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/coin_icon_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart'; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
@ -265,8 +266,10 @@ class _DesktopWalletViewState extends ConsumerState<DesktopWalletView> {
const SizedBox( const SizedBox(
width: 15, width: 15,
), ),
SvgPicture.asset( SvgPicture.file(
ref.watch(coinIconProvider(coin)), File(
ref.watch(coinIconProvider(coin)),
),
width: 32, width: 32,
height: 32, height: 32,
), ),
@ -321,8 +324,10 @@ class _DesktopWalletViewState extends ConsumerState<DesktopWalletView> {
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(20),
child: Row( child: Row(
children: [ children: [
SvgPicture.asset( SvgPicture.file(
ref.watch(coinIconProvider(coin)), File(
ref.watch(coinIconProvider(coin)),
),
width: 40, width: 40,
height: 40, height: 40,
), ),

View file

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@ -347,8 +348,10 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
label: "Buy", label: "Buy",
width: buttonWidth, width: buttonWidth,
buttonHeight: ButtonHeight.l, buttonHeight: ButtonHeight.l,
icon: SvgPicture.asset( icon: SvgPicture.file(
ref.watch(themeProvider.select((value) => value.assets.buy)), File(
ref.watch(themeProvider.select((value) => value.assets.buy)),
),
height: 20, height: 20,
width: 20, width: 20,
color: Theme.of(context) color: Theme.of(context)