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:
David Adegoke
2026-06-04 18:17:35 +02:00
committed by GitHub
parent ba80309ff3
commit 74c7de1c9c
55 changed files with 235 additions and 213 deletions
+12 -5
View File
@@ -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)),
+6 -32
View File
@@ -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,
+31 -4
View File
@@ -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,
],
);
}
+1 -1
View File
@@ -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'});