mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
Generic fixes (#3292)
* Add masked token image to to currency picker items and adjust estacked badge icon for node share qr * fix: Missing chain images in bridge flow * chore: Update image paths * fix: WC connection not triggering for Solana from scan qr * fix: Wallet icon and eth currency icon displaying wrongly in various places for Base wallets
This commit is contained in:
@@ -57,7 +57,7 @@ class BridgeNetworkPage extends StatelessWidget {
|
||||
(chain) {
|
||||
final chainName = chain.name;
|
||||
return ListItemRegularRow(
|
||||
iconPath: 'assets/images/crypto/${chainName.toLowerCase()}.webp',
|
||||
iconPath: 'assets/new-ui/crypto_full_icons/${chainName.toLowerCase()}.svg',
|
||||
keyValue: chain.chainId.toString(),
|
||||
label: chainName,
|
||||
onTap: () {
|
||||
|
||||
@@ -63,7 +63,7 @@ class _BridgeReceivingWalletPageState extends State<BridgeReceivingWalletPage> {
|
||||
child: CakeImageWidget(
|
||||
borderRadius: 8,
|
||||
imageUrl: chainName.isNotEmpty
|
||||
? 'assets/images/crypto/${chainName.toLowerCase()}.webp'
|
||||
? 'assets/new-ui/crypto_full_icons/${chainName.toLowerCase()}.svg'
|
||||
: null,
|
||||
width: 72,
|
||||
height: 72,
|
||||
|
||||
@@ -88,7 +88,7 @@ class TransferHistoryRow extends StatelessWidget {
|
||||
child: Stack(
|
||||
children: [
|
||||
CakeImageWidget(
|
||||
imageUrl: 'assets/images/crypto/${sourceChainName?.toLowerCase()}.webp',
|
||||
imageUrl: 'assets/new-ui/crypto_full_icons/${sourceChainName?.toLowerCase()}.svg',
|
||||
width: 28,
|
||||
height: 28,
|
||||
),
|
||||
@@ -96,7 +96,7 @@ class TransferHistoryRow extends StatelessWidget {
|
||||
top: 14,
|
||||
left: 12,
|
||||
child: CakeImageWidget(
|
||||
imageUrl: 'assets/images/crypto/${destChainName?.toLowerCase()}.webp',
|
||||
imageUrl: 'assets/new-ui/crypto_full_icons/${destChainName?.toLowerCase()}.svg',
|
||||
width: 28,
|
||||
height: 28,
|
||||
),
|
||||
|
||||
@@ -174,12 +174,14 @@ class CoinActionRow extends StatelessWidget {
|
||||
} else if (OpenCryptoPayService.isOpenCryptoPayQR(code)) {
|
||||
req = PaymentRequest(code, "", "", "", "");
|
||||
} else if (Uri.tryParse(code)?.scheme == "wc") {
|
||||
if (!isEVMCompatibleChain(walletType)) {
|
||||
if (!isWalletConnectCompatibleChain(walletType)) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (context) => AlertWithOneAction(
|
||||
alertTitle: "WalletConnect",
|
||||
alertContent: S.of(context).switchToEVMCompatibleWallet,
|
||||
alertContent: S
|
||||
.of(context)
|
||||
.switchToWCCompatibleWallet(walletConnectCompatibleChainsLabel()),
|
||||
buttonText: "OK",
|
||||
buttonAction: Navigator.of(context).pop));
|
||||
return;
|
||||
|
||||
@@ -4,8 +4,8 @@ import 'package:cake_wallet/new-ui/widgets/coins_page/assets_history/asset_detai
|
||||
import 'package:cake_wallet/new-ui/widgets/coins_page/token_image_widget.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_connect/utils/string_parsing.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/wallet_base.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AssetTile extends StatelessWidget {
|
||||
@@ -34,7 +34,7 @@ class AssetTile extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final iconPath = _getIconPath();
|
||||
final iconPath = balance.asset.iconPath ?? "";
|
||||
|
||||
return GestureDetector(
|
||||
onTap: (){
|
||||
@@ -161,18 +161,5 @@ class AssetTile extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
String _getChainTitle() {
|
||||
try {
|
||||
return CryptoCurrency.fromString(wallet.currency.tag ??wallet.currency.title).fullName ?? "";
|
||||
} catch(e) {
|
||||
return wallet.currency.fullName ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
String _getIconPath() {
|
||||
if(balance.asset == CryptoCurrency.baseEth)
|
||||
return "assets/new-ui/crypto_full_icons/base.svg";
|
||||
|
||||
return balance.asset.iconPath ?? "";
|
||||
}
|
||||
String _getChainTitle() => walletTypeToDisplayName(wallet.type);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/coins_page/token_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -86,11 +87,9 @@ class _IconWithBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final icon = CakeImageWidget(
|
||||
imageUrl: currency.iconPath,
|
||||
width: 32,
|
||||
height: 32,
|
||||
fit: BoxFit.cover,
|
||||
final icon = TokenImageWidget(
|
||||
imageUrl: currency.iconPath ?? '',
|
||||
size: 32,
|
||||
errorWidget: Container(
|
||||
width: 32,
|
||||
height: 32,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -62,7 +63,10 @@ class CurrencyPickerSearchField extends StatelessWidget {
|
||||
bool currencyMatchesQuery(CryptoCurrency c, String query) {
|
||||
if (query.isEmpty) return true;
|
||||
final q = query.toLowerCase();
|
||||
return c.title.toLowerCase().contains(q) ||
|
||||
c.name.toLowerCase().contains(q) ||
|
||||
(c.fullName?.toLowerCase().contains(q) ?? false);
|
||||
if (c.title.toLowerCase().contains(q)) return true;
|
||||
if (c.name.toLowerCase().contains(q)) return true;
|
||||
if (c.fullName?.toLowerCase().contains(q) ?? false) return true;
|
||||
if (c.tag?.toLowerCase().contains(q) ?? false) return true;
|
||||
if (chainNameForCurrency(c).toLowerCase().contains(q)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/coins_page/token_image_widget.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/currency_picker/chain_chip_strip.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/currency_picker/picker_recents_loader.dart';
|
||||
@@ -8,7 +9,6 @@ import 'package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_searc
|
||||
import 'package:cake_wallet/new-ui/widgets/currency_picker/picker_section_header.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/currency_picker/pill_grid.dart';
|
||||
import 'package:cake_wallet/new-ui/widgets/currency_picker/select_network_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cake_wallet/wallet_types.g.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/currency_for_wallet_type.dart';
|
||||
@@ -651,11 +651,9 @@ class _RecentPill extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CakeImageWidget(
|
||||
imageUrl: currency.iconPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.cover,
|
||||
TokenImageWidget(
|
||||
imageUrl: currency.iconPath ?? '',
|
||||
size: 24,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/coins_page/token_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -71,11 +72,9 @@ class _PillCard extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
CakeImageWidget(
|
||||
imageUrl: currency.iconPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
fit: BoxFit.cover,
|
||||
TokenImageWidget(
|
||||
imageUrl: currency.iconPath ?? '',
|
||||
size: 24,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
|
||||
@@ -126,7 +126,7 @@ class _L2ActionWalletSelectorState extends State<L2ActionWalletSelector> {
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: WalletRow(
|
||||
currencyIconPath:
|
||||
walletTypeToCryptoCurrency(item.type).iconPath ?? "",
|
||||
getCryptoCurrencyIconForWalletListItem(item.type),
|
||||
walletName: item.name,
|
||||
isCurrent: item.name == widget.sendViewModel.wallet.name,
|
||||
isSelected: _selectedWalletIndex == index && !textEntered,
|
||||
|
||||
@@ -105,7 +105,7 @@ class _SwapAddressSelectionModalState extends State<SwapAddressSelectionModal> {
|
||||
!widget.exchangeViewModel.isSendFromExternal;
|
||||
}
|
||||
|
||||
final String currencyIconPath = walletTypeToCryptoCurrency(item.type).iconPath ?? "";
|
||||
final String currencyIconPath = getCryptoCurrencyIconForWalletListItem(item.type);
|
||||
|
||||
final bool hasAccounts =
|
||||
item.type == WalletType.monero && widget.isSelectingReceiver;
|
||||
|
||||
@@ -5,6 +5,22 @@ import 'package:cake_wallet/src/screens/wallet_connect/services/chain_service/so
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:cake_wallet/evm/evm.dart';
|
||||
|
||||
const List<WalletType> walletConnectCompatibleChains = [
|
||||
WalletType.ethereum,
|
||||
WalletType.polygon,
|
||||
WalletType.base,
|
||||
WalletType.arbitrum,
|
||||
WalletType.bsc,
|
||||
WalletType.solana,
|
||||
];
|
||||
|
||||
String walletConnectCompatibleChainsLabel() {
|
||||
final names = walletConnectCompatibleChains.map(walletTypeToDisplayName).toList();
|
||||
if (names.length <= 1) return names.join();
|
||||
final head = names.sublist(0, names.length - 1).join(', ');
|
||||
return '$head, and ${names.last}';
|
||||
}
|
||||
|
||||
bool isEVMCompatibleChain(WalletType walletType) {
|
||||
switch (walletType) {
|
||||
case WalletType.polygon:
|
||||
@@ -47,19 +63,8 @@ bool isNFTACtivatedChain(WalletType walletType, {int? chainId}) {
|
||||
}
|
||||
}
|
||||
|
||||
bool isWalletConnectCompatibleChain(WalletType walletType) {
|
||||
switch (walletType) {
|
||||
case WalletType.solana:
|
||||
case WalletType.polygon:
|
||||
case WalletType.ethereum:
|
||||
case WalletType.base:
|
||||
case WalletType.arbitrum:
|
||||
case WalletType.bsc:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool isWalletConnectCompatibleChain(WalletType walletType) =>
|
||||
walletConnectCompatibleChains.contains(walletType);
|
||||
|
||||
String getChainNameSpaceAndIdBasedOnWalletType(WalletType walletType, {int? chainId}) {
|
||||
if (chainId != null) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:cake_wallet/core/auth_service.dart';
|
||||
import 'package:cake_wallet/entities/contact_base.dart';
|
||||
import 'package:cake_wallet/entities/contact_record.dart';
|
||||
import 'package:cake_wallet/entities/wallet_contact.dart';
|
||||
import 'package:cake_wallet/entities/wallet_list_order_types.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
@@ -16,6 +17,8 @@ import 'package:cake_wallet/utils/feature_flag.dart';
|
||||
import 'package:cake_wallet/utils/show_bar.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/currency_for_wallet_type.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -281,8 +284,10 @@ class _ContactPageBodyState extends State<ContactPageBody> with SingleTickerProv
|
||||
}
|
||||
|
||||
Widget _buildCurrencyIcon(ContactBase contact) {
|
||||
final image = contact.type.iconPath;
|
||||
return image != null
|
||||
final image = (contact is WalletContact && contact.walletType != null)
|
||||
? getCryptoCurrencyIconForWalletListItem(contact.walletType!)
|
||||
: contact.type.iconPath;
|
||||
return (image != null && image.isNotEmpty)
|
||||
? CakeImageWidget(imageUrl: image, height: 24, width: 24)
|
||||
: const SizedBox(height: 24, width: 24);
|
||||
}
|
||||
@@ -373,9 +378,11 @@ class _ContactListBodyState extends State<ContactListBody> {
|
||||
}
|
||||
|
||||
Widget generateContactRaw(BuildContext context, ContactRecord contact, bool isLast) {
|
||||
final image = contact.type.iconPath;
|
||||
final currencyIcon = image != null
|
||||
? Image.asset(image, height: 24, width: 24)
|
||||
final image = contact.type == CryptoCurrency.baseEth
|
||||
? 'assets/new-ui/crypto_full_icons/base.svg'
|
||||
: contact.type.iconPath;
|
||||
final currencyIcon = (image != null && image.isNotEmpty)
|
||||
? CakeImageWidget(imageUrl: image, height: 24, width: 24)
|
||||
: const SizedBox(height: 24, width: 24);
|
||||
return Column(
|
||||
children: [
|
||||
|
||||
@@ -31,26 +31,26 @@ class DesktopWalletSelectionDropDown extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionDropDown> {
|
||||
final moneroIcon = Image.asset('assets/images/crypto/monero.webp', height: 24, width: 24);
|
||||
final bitcoinIcon = Image.asset('assets/images/crypto/bitcoin.webp', height: 24, width: 24);
|
||||
final moneroIcon = Image.asset('assets/new-ui/crypto_full_icons/monero.svg', height: 24, width: 24);
|
||||
final bitcoinIcon = Image.asset('assets/new-ui/crypto_full_icons/bitcoin.svg', height: 24, width: 24);
|
||||
final tBitcoinIcon = Image.asset('assets/images/tbtc.png', height: 24, width: 24);
|
||||
final litecoinIcon = Image.asset('assets/images/crypto/litecoin.webp', height: 24, width: 24);
|
||||
final litecoinIcon = Image.asset('assets/new-ui/crypto_full_icons/litecoin.svg', height: 24, width: 24);
|
||||
final havenIcon = Image.asset('assets/images/haven_logo.webp', height: 24, width: 24);
|
||||
final ethereumIcon = Image.asset('assets/images/crypto/ethereum.webp', height: 24, width: 24);
|
||||
final polygonIcon = Image.asset('assets/images/crypto/polygon.webp', height: 24, width: 24);
|
||||
final bitcoinCashIcon = Image.asset('assets/images/crypto/bitcoin-cash.webp', height: 24, width: 24);
|
||||
final baseIcon = Image.asset('assets/images/crypto/base_icon.webp', height: 24, width: 24);
|
||||
final arbitrumIcon = Image.asset('assets/images/crypto/arbitrum.webp', height: 24, width: 24);
|
||||
final bscIcon = Image.asset('assets/images/crypto/BNB.webp', height: 24, width: 24);
|
||||
final nanoIcon = Image.asset('assets/images/crypto/nano.webp', height: 24, width: 24);
|
||||
final bananoIcon = Image.asset('assets/images/crypto/nano.webp', height: 24, width: 24);
|
||||
final solanaIcon = Image.asset('assets/images/crypto/solana.webp', height: 24, width: 24);
|
||||
final tronIcon = Image.asset('assets/images/crypto/tron.webp', height: 24, width: 24);
|
||||
final wowneroIcon = Image.asset('assets/images/crypto/wownero.webp', height: 24, width: 24);
|
||||
final zanoIcon = Image.asset('assets/images/crypto/zano.webp', height: 24, width: 24);
|
||||
final decredIcon = Image.asset('assets/images/crypto/decred.webp', height: 24, width: 24);
|
||||
final dogeIcon = Image.asset('assets/images/crypto/dogecoin.webp', height: 24, width: 24);
|
||||
final zcashIcon = Image.asset('assets/images/crypto/zcash.webp', height: 24, width: 24);
|
||||
final ethereumIcon = Image.asset('assets/new-ui/crypto_full_icons/ethereum.svg', height: 24, width: 24);
|
||||
final polygonIcon = Image.asset('assets/new-ui/crypto_full_icons/polygon.svg', height: 24, width: 24);
|
||||
final bitcoinCashIcon = Image.asset('assets/new-ui/crypto_full_icons/bitcoin-cash.svg', height: 24, width: 24);
|
||||
final baseIcon = Image.asset('assets/new-ui/crypto_full_icons/base.svg', height: 24, width: 24);
|
||||
final arbitrumIcon = Image.asset('assets/new-ui/crypto_full_icons/arbitrum.svg', height: 24, width: 24);
|
||||
final bscIcon = Image.asset('assets/new-ui/crypto_full_icons/bnb.svg', height: 24, width: 24);
|
||||
final nanoIcon = Image.asset('assets/new-ui/crypto_full_icons/nano.svg', height: 24, width: 24);
|
||||
final bananoIcon = Image.asset('assets/new-ui/crypto_full_icons/nano.svg', height: 24, width: 24);
|
||||
final solanaIcon = Image.asset('assets/new-ui/crypto_full_icons/solana.svg', height: 24, width: 24);
|
||||
final tronIcon = Image.asset('assets/new-ui/crypto_full_icons/tron.svg', height: 24, width: 24);
|
||||
final wowneroIcon = Image.asset('assets/new-ui/crypto_full_icons/wownero.svg', height: 24, width: 24);
|
||||
final zanoIcon = Image.asset('assets/new-ui/crypto_full_icons/zano.svg', height: 24, width: 24);
|
||||
final decredIcon = Image.asset('assets/new-ui/crypto_full_icons/decred.svg', height: 24, width: 24);
|
||||
final dogeIcon = Image.asset('assets/new-ui/crypto_full_icons/dogecoin.svg', height: 24, width: 24);
|
||||
final zcashIcon = Image.asset('assets/new-ui/crypto_full_icons/zcash.svg', height: 24, width: 24);
|
||||
final nonWalletTypeIcon = Image.asset('assets/images/close.png', height: 24, width: 24);
|
||||
|
||||
Image _newWalletImage(BuildContext context) => Image.asset(
|
||||
|
||||
@@ -371,7 +371,7 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||
child: InfoCard(
|
||||
title: S.of(context).synchronizing,
|
||||
description: S.of(context).decred_info_card_details,
|
||||
image: 'assets/images/crypto/decred.webp',
|
||||
image: 'assets/new-ui/crypto_full_icons/decred.svg',
|
||||
leftButtonTitle: S.of(context).litecoin_mweb_dismiss,
|
||||
rightButtonTitle: S.of(context).learn_more,
|
||||
leftButtonAction: () => dashboardViewModel.dismissDecredInfoCard(),
|
||||
|
||||
@@ -24,25 +24,25 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
this.tileHeight = 60,
|
||||
this.fromTopEdge = 50,
|
||||
this.fromBottomEdge = 25,
|
||||
this.moneroIcon = Image.asset('assets/images/crypto/monero.webp'),
|
||||
this.bitcoinIcon = Image.asset('assets/images/crypto/bitcoin.webp'),
|
||||
this.litecoinIcon = Image.asset('assets/images/crypto/litecoin.webp'),
|
||||
this.moneroIcon = Image.asset('assets/new-ui/crypto_full_icons/monero.svg'),
|
||||
this.bitcoinIcon = Image.asset('assets/new-ui/crypto_full_icons/bitcoin.svg'),
|
||||
this.litecoinIcon = Image.asset('assets/new-ui/crypto_full_icons/litecoin.svg'),
|
||||
this.havenIcon = Image.asset('assets/images/haven_menu.webp'),
|
||||
this.ethereumIcon = Image.asset('assets/images/crypto/ethereum.webp'),
|
||||
this.nanoIcon = Image.asset('assets/images/crypto/nano.webp'),
|
||||
this.bananoIcon = Image.asset('assets/images/crypto/nano.webp'),
|
||||
this.bitcoinCashIcon = Image.asset('assets/images/crypto/bitcoin-cash.webp'),
|
||||
this.polygonIcon = Image.asset('assets/images/crypto/polygon.webp'),
|
||||
this.baseIcon = Image.asset('assets/images/crypto/base_icon.webp'),
|
||||
this.arbitrumIcon = Image.asset('assets/images/crypto/arbitrum.webp'),
|
||||
this.bscIcon = Image.asset('assets/images/crypto/BNB.webp'),
|
||||
this.solanaIcon = Image.asset('assets/images/crypto/solana.webp'),
|
||||
this.tronIcon = Image.asset('assets/images/crypto/tron.webp'),
|
||||
this.wowneroIcon = Image.asset('assets/images/crypto/wownero.webp'),
|
||||
this.zanoIcon = Image.asset('assets/images/crypto/zano.webp'),
|
||||
this.decredIcon = Image.asset('assets/images/crypto/decred.webp'),
|
||||
this.dogecoinIcon = Image.asset('assets/images/crypto/dogecoin.webp'),
|
||||
this.zcashIcon = Image.asset('assets/images/crypto/zcash.webp');
|
||||
this.ethereumIcon = Image.asset('assets/new-ui/crypto_full_icons/ethereum.svg'),
|
||||
this.nanoIcon = Image.asset('assets/new-ui/crypto_full_icons/nano.svg'),
|
||||
this.bananoIcon = Image.asset('assets/new-ui/crypto_full_icons/nano.svg'),
|
||||
this.bitcoinCashIcon = Image.asset('assets/new-ui/crypto_full_icons/bitcoin-cash.svg'),
|
||||
this.polygonIcon = Image.asset('assets/new-ui/crypto_full_icons/polygon.svg'),
|
||||
this.baseIcon = Image.asset('assets/new-ui/crypto_full_icons/base.svg'),
|
||||
this.arbitrumIcon = Image.asset('assets/new-ui/crypto_full_icons/arbitrum.svg'),
|
||||
this.bscIcon = Image.asset('assets/new-ui/crypto_full_icons/bnb.svg'),
|
||||
this.solanaIcon = Image.asset('assets/new-ui/crypto_full_icons/solana.svg'),
|
||||
this.tronIcon = Image.asset('assets/new-ui/crypto_full_icons/tron.svg'),
|
||||
this.wowneroIcon = Image.asset('assets/new-ui/crypto_full_icons/wownero.svg'),
|
||||
this.zanoIcon = Image.asset('assets/new-ui/crypto_full_icons/zano.svg'),
|
||||
this.decredIcon = Image.asset('assets/new-ui/crypto_full_icons/decred.svg'),
|
||||
this.dogecoinIcon = Image.asset('assets/new-ui/crypto_full_icons/dogecoin.svg'),
|
||||
this.zcashIcon = Image.asset('assets/new-ui/crypto_full_icons/zcash.svg');
|
||||
|
||||
final largeScreen = 731;
|
||||
|
||||
@@ -122,8 +122,8 @@ class MenuWidgetState extends State<MenuWidget> {
|
||||
}
|
||||
int itemCount = items.length;
|
||||
|
||||
moneroIcon = Image.asset('assets/images/crypto/monero.webp');
|
||||
bitcoinIcon = Image.asset('assets/images/crypto/bitcoin.webp');
|
||||
moneroIcon = Image.asset('assets/new-ui/crypto_full_icons/monero.svg');
|
||||
bitcoinIcon = Image.asset('assets/new-ui/crypto_full_icons/bitcoin.svg');
|
||||
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
|
||||
@@ -149,7 +149,6 @@ class WalletTypeFormState extends State<WalletTypeForm> {
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
final item = filteredTypes[index];
|
||||
final curr = getCryptoCurrencyForWalletListItem(item);
|
||||
|
||||
return GestureDetector(
|
||||
key: ValueKey('new_wallet_type_${item.name}_button_key'),
|
||||
@@ -169,7 +168,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
|
||||
CakeImageWidget(
|
||||
height: 24,
|
||||
width: 24,
|
||||
imageUrl: curr.iconPath,
|
||||
imageUrl: getCryptoCurrencyIconForWalletListItem(item),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Text(walletTypeToDisplayName(item)),
|
||||
|
||||
@@ -31,38 +31,12 @@ class NodeSharePage extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 40,
|
||||
children: [
|
||||
Stack(alignment: Alignment.center, children: [
|
||||
SizedBox(
|
||||
width: qrSize,
|
||||
height: qrSize,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
child: QrImage(
|
||||
size: qrSize - padding * 2,
|
||||
embeddedImagePath: "",
|
||||
data: uri.toString())),
|
||||
),
|
||||
SizedBox(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: Stack(
|
||||
children: [
|
||||
CakeImageWidget(
|
||||
imageUrl: "assets/new-ui/settings_row_icons/nodes.svg",
|
||||
width: 54,
|
||||
height: 54,
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: CakeImageWidget(
|
||||
imageUrl: currency.iconPath,
|
||||
width: 24,
|
||||
height: 24,
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
QrImage(
|
||||
size: qrSize - padding * 2,
|
||||
embeddedImagePath: "assets/new-ui/node-qr-icon.svg",
|
||||
badgeImageOnEmbeddedImagePath: currency.iconPath,
|
||||
data: uri.toString(),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 36.0),
|
||||
child: Text(S.of(context).node_share_desc,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cake_wallet/new-ui/widgets/coins_page/token_image_widget.dart';
|
||||
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart' as qr;
|
||||
|
||||
@@ -11,6 +12,7 @@ class QrImage extends StatelessWidget {
|
||||
this.version,
|
||||
this.errorCorrectionLevel = qr.QrErrorCorrectLevel.H,
|
||||
this.embeddedImagePath,
|
||||
this.badgeImageOnEmbeddedImagePath,
|
||||
});
|
||||
|
||||
final double? size;
|
||||
@@ -20,6 +22,7 @@ class QrImage extends StatelessWidget {
|
||||
final int? version;
|
||||
final int errorCorrectionLevel;
|
||||
final String? embeddedImagePath;
|
||||
final String? badgeImageOnEmbeddedImagePath;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -27,6 +30,33 @@ class QrImage extends StatelessWidget {
|
||||
final qrSize = size ?? 100.0;
|
||||
final logoSize = qrSize * 0.30;
|
||||
|
||||
final centerImage = TokenImageWidget(
|
||||
imageUrl: imagePath,
|
||||
size: logoSize * 0.8,
|
||||
);
|
||||
|
||||
Widget centerImageToUse;
|
||||
if (badgeImageOnEmbeddedImagePath != null) {
|
||||
centerImageToUse = Stack(
|
||||
children: [
|
||||
centerImage,
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: CakeImageWidget(
|
||||
imageUrl: badgeImageOnEmbeddedImagePath!,
|
||||
width: 24,
|
||||
height: 24,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
centerImageToUse = centerImage;
|
||||
}
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
@@ -39,10 +69,7 @@ class QrImage extends StatelessWidget {
|
||||
backgroundColor: backgroundColor,
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
),
|
||||
TokenImageWidget(
|
||||
imageUrl: imagePath,
|
||||
size: logoSize * 0.8,
|
||||
),
|
||||
centerImageToUse,
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class SettingActions {
|
||||
static SettingActions exportOutputsAction = SettingActions._(
|
||||
key: ValueKey('dashboard_page_menu_widget_export_outputs_settings_button_key'),
|
||||
name: (context) => S.of(context).export_outputs,
|
||||
image: 'assets/images/crypto/monero.webp',
|
||||
image: 'assets/new-ui/crypto_full_icons/monero.svg',
|
||||
onTap: (BuildContext context) {
|
||||
Navigator.of(context)
|
||||
.pushNamed(Routes.urqrAnimatedPage, arguments: {'export-outputs': 'export-outputs'});
|
||||
|
||||
@@ -34,7 +34,7 @@ class LinkViewModel {
|
||||
String? getRouteToGo() {
|
||||
if (isWalletConnectLink) {
|
||||
if (!isWalletConnectCompatibleChain(appStore.wallet!.type)) {
|
||||
_errorToast(S.current.switchToEVMCompatibleWallet);
|
||||
_errorToast(S.current.switchToWCCompatibleWallet(walletConnectCompatibleChainsLabel()));
|
||||
return null;
|
||||
}
|
||||
return Routes.walletConnectConnectionsListing;
|
||||
|
||||
@@ -481,7 +481,7 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
|
||||
];
|
||||
case 137:
|
||||
return [
|
||||
'assets/images/crypto/polygon.webp',
|
||||
'assets/new-ui/crypto_full_icons/polygon.svg',
|
||||
'assets/images/eth_pol_icon.svg',
|
||||
'assets/images/usdc_icon.svg',
|
||||
'assets/images/usdt_wallet_icon.svg',
|
||||
@@ -495,20 +495,20 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
|
||||
];
|
||||
case 42161:
|
||||
return [
|
||||
'assets/images/crypto/arbitrum.webp',
|
||||
'assets/new-ui/crypto_full_icons/arbitrum.svg',
|
||||
'assets/images/usdc_icon.svg',
|
||||
'assets/images/more_tokens.svg',
|
||||
];
|
||||
case 56:
|
||||
return [
|
||||
'assets/images/crypto/BNB.webp',
|
||||
'assets/new-ui/crypto_full_icons/bnb.svg',
|
||||
'assets/images/usdc_icon.svg',
|
||||
'assets/images/usdt_wallet_icon.svg',
|
||||
'assets/images/more_tokens.svg',
|
||||
];
|
||||
default:
|
||||
return [
|
||||
'assets/images/crypto/ethereum.webp',
|
||||
'assets/new-ui/crypto_full_icons/ethereum.svg',
|
||||
'assets/images/usdc_icon.svg',
|
||||
'assets/images/usdt_wallet_icon.svg',
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user