diff --git a/lib/main.dart b/lib/main.dart index d9d7d4851..94a624eb9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -178,9 +178,6 @@ void main() async { } } - //Add Themes directory - TODO - // await StackFileSystem.applicationThemesDirectory(); - monero.onStartup(); wownero.onStartup(); diff --git a/lib/notifications/notification_card.dart b/lib/notifications/notification_card.dart index 4470fd63b..c8f09ec7e 100644 --- a/lib/notifications/notification_card.dart +++ b/lib/notifications/notification_card.dart @@ -1,7 +1,14 @@ +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/isar/stack_theme.dart'; import 'package:stackwallet/models/notification_model.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/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/util.dart'; @@ -9,7 +16,7 @@ import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/rounded_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; -class NotificationCard extends StatelessWidget { +class NotificationCard extends ConsumerWidget { const NotificationCard({ Key? key, required this.notification, @@ -25,8 +32,17 @@ class NotificationCard extends StatelessWidget { static const double mobileIconSize = 24; static const double desktopIconSize = 30; + String coinIconPath(ThemeAssets assets, WidgetRef ref) { + try { + final coin = coinFromPrettyName(notification.coinName); + return ref.read(coinIconProvider(coin)); + } catch (_) { + return notification.iconAssetName; + } + } + @override - Widget build(BuildContext context) { + Widget build(BuildContext context, WidgetRef ref) { final isDesktop = Util.isDesktop; return Stack( @@ -41,8 +57,14 @@ class NotificationCard extends StatelessWidget { child: Row( children: [ notification.changeNowId == null - ? SvgPicture.asset( - notification.iconAssetName, + ? SvgPicture.file( + File( + coinIconPath( + ref.watch( + themeProvider.select((value) => value.assets), + ), + ref), + ), width: isDesktop ? desktopIconSize : mobileIconSize, height: isDesktop ? desktopIconSize : mobileIconSize, ) @@ -53,8 +75,14 @@ class NotificationCard extends StatelessWidget { color: Colors.transparent, borderRadius: BorderRadius.circular(24), ), - child: SvgPicture.asset( - notification.iconAssetName, + child: SvgPicture.file( + File( + coinIconPath( + ref.watch( + themeProvider.select((value) => value.assets), + ), + ref), + ), color: Theme.of(context) .extension()! .accentColorDark, diff --git a/lib/pages/address_book_views/subviews/coin_select_sheet.dart b/lib/pages/address_book_views/subviews/coin_select_sheet.dart index a6bf470f8..d343dbdbb 100644 --- a/lib/pages/address_book_views/subviews/coin_select_sheet.dart +++ b/lib/pages/address_book_views/subviews/coin_select_sheet.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/providers/global/prefs_provider.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/coin_image_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'; @@ -87,8 +89,10 @@ class CoinSelectSheet extends StatelessWidget { padding: const EdgeInsets.all(12), child: Row( children: [ - SvgPicture.asset( - ref.watch(coinImageProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinImageProvider(coin)), + ), height: 20, width: 20, ), diff --git a/lib/pages/address_book_views/subviews/contact_details_view.dart b/lib/pages/address_book_views/subviews/contact_details_view.dart index bd5efd1c5..2128f6e4c 100644 --- a/lib/pages/address_book_views/subviews/contact_details_view.dart +++ b/lib/pages/address_book_views/subviews/contact_details_view.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -13,8 +15,8 @@ import 'package:stackwallet/providers/global/address_book_service_provider.dart' import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/address_book_providers/address_entry_data_provider.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/assets.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -334,8 +336,10 @@ class _ContactDetailsViewState extends ConsumerState { padding: const EdgeInsets.all(12), child: Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(e.coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(e.coin)), + ), height: 24, ), const SizedBox( diff --git a/lib/pages/address_book_views/subviews/contact_popup.dart b/lib/pages/address_book_views/subviews/contact_popup.dart index b09aba6ef..88cad7f33 100644 --- a/lib/pages/address_book_views/subviews/contact_popup.dart +++ b/lib/pages/address_book_views/subviews/contact_popup.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -9,8 +11,8 @@ import 'package:stackwallet/pages/exchange_view/exchange_step_views/step_2_view. import 'package:stackwallet/pages/send_view/send_view.dart'; import 'package:stackwallet/providers/global/address_book_service_provider.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/themes/theme_providers.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; @@ -110,11 +112,13 @@ class ContactPopUp extends ConsumerWidget { ), child: contact.id == "default" ? Center( - child: SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => - value.assets.stackIcon, + child: SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value + .assets.stackIcon, + ), ), ), width: 20, @@ -211,9 +215,11 @@ class ContactPopUp extends ConsumerWidget { const SizedBox( height: 2, ), - SvgPicture.asset( - ref.watch( - coinIconProvider(e.coin), + SvgPicture.file( + File( + ref.watch( + coinIconProvider(e.coin), + ), ), height: 24, ), diff --git a/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart b/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart index c23a362df..cf315130c 100644 --- a/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart +++ b/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -7,8 +9,8 @@ import 'package:stackwallet/pages/address_book_views/subviews/coin_select_sheet. import 'package:stackwallet/providers/providers.dart'; // import 'package:stackwallet/providers/global/should_show_lockscreen_on_resume_state_provider.dart'; import 'package:stackwallet/providers/ui/address_book_providers/address_entry_data_provider.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/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; @@ -141,8 +143,10 @@ class _NewContactAddressEntryFormState padding: const EdgeInsets.symmetric(vertical: 4), child: Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), height: 24, width: 24, ), @@ -211,15 +215,17 @@ class _NewContactAddressEntryFormState ) : Row( children: [ - SvgPicture.asset( - ref.watch( - coinIconProvider( - ref.watch( - addressEntryDataProvider(widget.id) - .select( - (value) => value.coin, - ), - )!, + SvgPicture.file( + File( + ref.watch( + coinIconProvider( + ref.watch( + addressEntryDataProvider(widget.id) + .select( + (value) => value.coin, + ), + )!, + ), ), ), height: 20, diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index 154acead7..bd2f6b70e 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -144,7 +144,7 @@ class _ReceiveViewState extends ConsumerState { aspectRatio: 1, child: AppBarIconButton( semanticsLabel: - "Address List Pop-up Button. Opens A Pop-up For Adress List Button.", + "Address List Pop-up Button. Opens A Pop-up For Address List Button.", key: const Key("walletNetworkSettingsAddNewNodeViewButton"), size: 36, shadows: const [], diff --git a/lib/pages/settings_views/global_settings_view/global_settings_view.dart b/lib/pages/settings_views/global_settings_view/global_settings_view.dart index 28e410c99..582ccfde5 100644 --- a/lib/pages/settings_views/global_settings_view/global_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/global_settings_view.dart @@ -191,7 +191,8 @@ class GlobalSettingsView extends StatelessWidget { title: "Appearance", onPressed: () { Navigator.of(context).pushNamed( - AppearanceSettingsView.routeName); + AppearanceSettingsView.routeName, + ); }, ), if (Platform.isIOS) diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart index fbd0e82a6..2db94aff7 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_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/svg.dart'; @@ -6,8 +8,8 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_item_card.dart'; import 'package:stackwallet/providers/stack_restore/stack_restoring_ui_state_provider.dart'; import 'package:stackwallet/route_generator.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/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/stack_restoring_status.dart'; @@ -81,8 +83,10 @@ class _RestoringWalletCardState extends ConsumerState { .extension()! .colorForCoin(coin), child: Center( - child: SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + child: SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), height: 20, width: 20, ), @@ -222,9 +226,11 @@ class _RestoringWalletCardState extends ConsumerState { .extension()! .colorForCoin(coin), child: Center( - child: SvgPicture.asset( - ref.watch( - coinIconProvider(coin), + child: SvgPicture.file( + File( + ref.watch( + coinIconProvider(coin), + ), ), height: 20, width: 20, diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart index f61fd7420..b76b63f46 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_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/flutter_svg.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_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/text_styles.dart'; import 'package:stackwallet/widgets/background.dart'; @@ -236,22 +238,24 @@ class _StartupPreferencesViewState .only(top: 12), child: Row( children: [ - SvgPicture.asset( - ref.watch( - coinIconProvider( - ref - .watch( - walletsChangeNotifierProvider - .select( - (value) => - value.getManager( - ref.watch( - prefsChangeNotifierProvider.select((value) => value.startupWalletId!), + SvgPicture.file( + File( + ref.watch( + coinIconProvider( + ref + .watch( + walletsChangeNotifierProvider + .select( + (value) => + value.getManager( + ref.watch( + prefsChangeNotifierProvider.select((value) => value.startupWalletId!), + ), ), ), - ), - ) - .coin, + ) + .coin, + ), ), ), ), diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart index 047627c38..9b8a95909 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_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/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/text_styles.dart'; import 'package:stackwallet/widgets/background.dart'; @@ -102,9 +104,11 @@ class _StartupWalletSelectionViewState ), child: Padding( padding: const EdgeInsets.all(4), - child: SvgPicture.asset( - ref.watch( - coinIconProvider(manager.coin), + child: SvgPicture.file( + File( + ref.watch( + coinIconProvider(manager.coin), + ), ), width: 20, height: 20, diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart index ffa386877..ad0042dc8 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_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/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/enums/sync_type_enum.dart'; @@ -116,9 +118,11 @@ class WalletSyncingOptionsView extends ConsumerWidget { ), child: Padding( padding: const EdgeInsets.all(4), - child: SvgPicture.asset( - ref.watch( - coinIconProvider(manager.coin), + child: SvgPicture.file( + File( + ref.watch( + coinIconProvider(manager.coin), + ), ), width: 20, height: 20, diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart index 8bef9d88b..26c94e4be 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart @@ -33,7 +33,7 @@ import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:tuple/tuple.dart'; /// [eventBus] should only be set during testing -class WalletSettingsView extends StatefulWidget { +class WalletSettingsView extends ConsumerStatefulWidget { const WalletSettingsView({ Key? key, required this.walletId, @@ -52,10 +52,10 @@ class WalletSettingsView extends StatefulWidget { final EventBus? eventBus; @override - State createState() => _WalletSettingsViewState(); + ConsumerState createState() => _WalletSettingsViewState(); } -class _WalletSettingsViewState extends State { +class _WalletSettingsViewState extends ConsumerState { late final String walletId; late final Coin coin; late String xpub; @@ -74,7 +74,7 @@ class _WalletSettingsViewState extends State { walletId = widget.walletId; coin = widget.coin; xPubEnabled = - coin != Coin.monero && coin != Coin.wownero && coin != Coin.epicCash; + ref.read(walletsChangeNotifierProvider).getManager(walletId).hasXPub; xpub = ""; _currentSyncStatus = widget.initialSyncStatus; diff --git a/lib/pages/wallet_view/sub_widgets/tx_icon.dart b/lib/pages/wallet_view/sub_widgets/tx_icon.dart index 74c179b47..5b85861c0 100644 --- a/lib/pages/wallet_view/sub_widgets/tx_icon.dart +++ b/lib/pages/wallet_view/sub_widgets/tx_icon.dart @@ -23,19 +23,6 @@ class TxIcon extends ConsumerWidget { static const Size size = Size(32, 32); - // String _getBundleAssetName( - // bool isCancelled, bool isReceived, bool isPending, BuildContext context) { - // if (!isReceived && transaction.subType == TransactionSubType.mint) { - // if (isCancelled) { - // return Assets.svg.anonymizeFailed; - // } - // if (isPending) { - // return Assets.svg.anonymizePending; - // } - // return Assets.svg.anonymize; - // } - // } - String _getAssetName( bool isCancelled, bool isReceived, bool isPending, ThemeAssets assets) { if (!isReceived && transaction.subType == TransactionSubType.mint) { diff --git a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart index 8b56a9cf5..99fd380bc 100644 --- a/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart +++ b/lib/pages_desktop_specific/address_book_view/subwidgets/desktop_contact_details.dart @@ -1,7 +1,10 @@ +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:isar/isar.dart'; +import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/contact.dart'; import 'package:stackwallet/models/isar/models/isar_models.dart'; import 'package:stackwallet/pages/address_book_views/subviews/add_new_contact_address_view.dart'; @@ -24,8 +27,6 @@ import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/transaction_card.dart'; import 'package:tuple/tuple.dart'; -import '../../../db/isar/main_db.dart'; - class DesktopContactDetails extends ConsumerStatefulWidget { const DesktopContactDetails({ Key? key, @@ -119,10 +120,12 @@ class _DesktopContactDetailsState extends ConsumerState { ), child: contact.id == "default" ? Center( - child: SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stackIcon, + child: SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stackIcon, + ), ), ), width: 32, diff --git a/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart b/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart index 7fce59bdb..e14d8bb19 100644 --- a/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.dart +++ b/lib/pages_desktop_specific/coin_control/desktop_coin_control_use_dialog.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'; @@ -6,8 +8,8 @@ import 'package:stackwallet/db/isar/main_db.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart'; import 'package:stackwallet/pages_desktop_specific/coin_control/utxo_row.dart'; import 'package:stackwallet/providers/global/wallets_provider.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'; @@ -359,8 +361,10 @@ class _DesktopCoinControlUseDialogState color: Colors.transparent, 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_desktop_specific/coin_control/desktop_coin_control_view.dart b/lib/pages_desktop_specific/coin_control/desktop_coin_control_view.dart index af41ad1a8..0685204e4 100644 --- a/lib/pages_desktop_specific/coin_control/desktop_coin_control_view.dart +++ b/lib/pages_desktop_specific/coin_control/desktop_coin_control_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'; @@ -7,8 +9,8 @@ import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart'; import 'package:stackwallet/pages_desktop_specific/coin_control/freeze_button.dart'; import 'package:stackwallet/pages_desktop_specific/coin_control/utxo_row.dart'; import 'package:stackwallet/providers/global/wallets_provider.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'; @@ -343,8 +345,10 @@ class _DesktopCoinControlViewState color: Colors.transparent, 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_desktop_specific/desktop_exchange/desktop_all_trades_view.dart b/lib/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart index 209c3c28c..4fcbb5a82 100644 --- a/lib/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart +++ b/lib/pages_desktop_specific/desktop_exchange/desktop_all_trades_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; @@ -522,10 +523,14 @@ class _DesktopTradeRowCardState extends ConsumerState { borderRadius: BorderRadius.circular(32), ), child: Center( - child: SvgPicture.asset( - _fetchIconAssetForStatus( - trade.status, - ref.watch(themeProvider.select((value) => value.assets)), + child: SvgPicture.file( + File( + _fetchIconAssetForStatus( + trade.status, + ref.watch( + themeProvider.select((value) => value.assets), + ), + ), ), width: 32, height: 32, diff --git a/lib/pages_desktop_specific/desktop_menu_item.dart b/lib/pages_desktop_specific/desktop_menu_item.dart index 4f27a1af0..10c2ad25d 100644 --- a/lib/pages_desktop_specific/desktop_menu_item.dart +++ b/lib/pages_desktop_specific/desktop_menu_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'; @@ -81,28 +83,36 @@ class DesktopNotificationsIcon extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - return SvgPicture.asset( - ref.watch(notificationsProvider - .select((value) => value.hasUnreadNotifications)) - ? ref.watch( - themeProvider.select( - (value) => value.assets.bellNew, + return 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 - : DesktopMenuItemId.notifications == - ref.watch(currentDesktopMenuItemProvider.state).state - ? Theme.of(context).extension()!.accentColorDark - : Theme.of(context) - .extension()! - .accentColorDark - .withOpacity(0.8), - ); + ), + width: 20, + height: 20, + ) + : SvgPicture.asset( + Assets.svg.bell, + width: 20, + height: 20, + color: ref.watch(notificationsProvider + .select((value) => value.hasUnreadNotifications)) + ? null + : DesktopMenuItemId.notifications == + ref.watch(currentDesktopMenuItemProvider.state).state + ? Theme.of(context) + .extension()! + .accentColorDark + : Theme.of(context) + .extension()! + .accentColorDark + .withOpacity(0.8), + ); } } diff --git a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart b/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart index 1b327ccea..cf231a30c 100644 --- a/lib/pages_desktop_specific/my_stack_view/my_stack_view.dart +++ b/lib/pages_desktop_specific/my_stack_view/my_stack_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/flutter_svg.dart'; @@ -53,10 +55,12 @@ class DesktopMyStackTitle extends ConsumerWidget { SizedBox( width: 32, height: 32, - 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_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.dart b/lib/pages_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.dart index 8b8712740..8776a3394 100644 --- a/lib/pages_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.dart +++ b/lib/pages_desktop_specific/my_stack_view/paynym/desktop_paynym_send_dialog.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'; @@ -10,8 +12,8 @@ import 'package:stackwallet/providers/global/price_provider.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.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/barcode_scanner_interface.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; @@ -81,8 +83,10 @@ class _DesktopPaynymSendDialogState // Theme.of(context).extension()!.textSubtitle4, child: Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 36, height: 36, ), diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart b/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart index b34709680..4a14cb5a5 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_summary_table.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/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/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -141,8 +143,10 @@ class _DesktopWalletSummaryRowState flex: 4, child: Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(widget.coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(widget.coin)), + ), width: 28, height: 28, ), diff --git a/lib/pages_desktop_specific/password/delete_password_warning_view.dart b/lib/pages_desktop_specific/password/delete_password_warning_view.dart index 3187eebc0..be2b29ab7 100644 --- a/lib/pages_desktop_specific/password/delete_password_warning_view.dart +++ b/lib/pages_desktop_specific/password/delete_password_warning_view.dart @@ -94,10 +94,12 @@ class _ForgotPasswordDesktopViewState child: Column( mainAxisSize: MainAxisSize.min, children: [ - SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stackIcon, + SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stackIcon, + ), ), ), width: 100, diff --git a/lib/pages_desktop_specific/password/desktop_login_view.dart b/lib/pages_desktop_specific/password/desktop_login_view.dart index fbaec5f29..40bd3919c 100644 --- a/lib/pages_desktop_specific/password/desktop_login_view.dart +++ b/lib/pages_desktop_specific/password/desktop_login_view.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -166,10 +167,12 @@ class _DesktopLoginViewState extends ConsumerState { child: Column( mainAxisSize: MainAxisSize.min, children: [ - SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stackIcon, + SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stackIcon, + ), ), ), width: 100, diff --git a/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart b/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart index 75b52d09b..381247639 100644 --- a/lib/pages_desktop_specific/password/forgot_password_desktop_view.dart +++ b/lib/pages_desktop_specific/password/forgot_password_desktop_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'; @@ -47,10 +49,12 @@ class _ForgotPasswordDesktopViewState child: Column( mainAxisSize: MainAxisSize.min, children: [ - SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stackIcon, + SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stackIcon, + ), ), ), width: 100, diff --git a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart index f2cc6f17b..7c39b6c91 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/nodes_settings.dart @@ -6,8 +6,8 @@ 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/route_generator.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'; @@ -250,8 +250,10 @@ class _NodesSettings extends ConsumerState { children: [ Row( children: [ - SvgPicture.asset( - ref.watch(coinIconProvider(coin)), + SvgPicture.file( + File( + ref.watch(coinIconProvider(coin)), + ), width: 24, height: 24, ), diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index 5dee0e430..cfa3b73cf 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -53,11 +53,11 @@ import 'package:uuid/uuid.dart'; const int MINIMUM_CONFIRMATIONS = 1; final Amount DUST_LIMIT = Amount( rawValue: BigInt.from(294), - fractionDigits: Coin.particl.decimals, + fractionDigits: Coin.bitcoin.decimals, ); final Amount DUST_LIMIT_P2PKH = Amount( rawValue: BigInt.from(546), - fractionDigits: Coin.particl.decimals, + fractionDigits: Coin.bitcoin.decimals, ); const String GENESIS_HASH_MAINNET = diff --git a/lib/widgets/address_book_card.dart b/lib/widgets/address_book_card.dart index 4fca40e01..de0871ae8 100644 --- a/lib/widgets/address_book_card.dart +++ b/lib/widgets/address_book_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/svg.dart'; @@ -5,6 +7,7 @@ import 'package:stackwallet/models/contact.dart'; import 'package:stackwallet/pages/address_book_views/subviews/contact_popup.dart'; import 'package:stackwallet/providers/global/address_book_service_provider.dart'; import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/themes/theme_providers.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -14,8 +17,6 @@ import 'package:stackwallet/widgets/conditional_parent.dart'; import 'package:stackwallet/widgets/expandable.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; -import '../themes/theme_providers.dart'; - class AddressBookCard extends ConsumerStatefulWidget { const AddressBookCard({ Key? key, @@ -92,10 +93,12 @@ class _AddressBookCardState extends ConsumerState { ), child: contact.id == "default" ? Center( - child: SvgPicture.asset( - ref.watch( - themeProvider.select( - (value) => value.assets.stackIcon, + child: SvgPicture.file( + File( + ref.watch( + themeProvider.select( + (value) => value.assets.stackIcon, + ), ), ), width: 20, diff --git a/lib/widgets/desktop/living_stack_icon.dart b/lib/widgets/desktop/living_stack_icon.dart index a5c17108a..166f30f9c 100644 --- a/lib/widgets/desktop/living_stack_icon.dart +++ b/lib/widgets/desktop/living_stack_icon.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'; @@ -47,10 +49,12 @@ class _LivingStackIconState extends ConsumerState { child: AnimatedScale( duration: const Duration(milliseconds: 200), scale: _hovering ? 1.2 : 1, - 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/pubspec.yaml b/pubspec.yaml index 2b8d498b8..08d4bb762 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -343,14 +343,9 @@ flutter: # exchange icons - assets/svg/exchange_icons/ - # theme selectors -# - assets/svg/dark-theme.svg -# - assets/svg/light-mode.svg - # buy - assets/svg/buy/ - # lottie animations # basic - assets/lottie/test2.json