From 52c380a4554d798d61ca483d98183cf69356568f Mon Sep 17 00:00:00 2001 From: David Adegoke <64401859+Blazebrain@users.noreply.github.com> Date: Wed, 3 Jun 2026 16:44:19 +0100 Subject: [PATCH] Unify svg and png rendering (#3288) * Improve token image display with mask and background * Enhance token image bg and remove wierd halo effect that was showing, also add token bg to disclaimer and picker * Add token bg to more locations and give another shot at halo * fix: halo around token images * add token background to non-transparent images only * another shot at bg based on transparency * refactor: enhance token image widget shape handling and add filter quality option to cake image widget * fix: another shot * refactor: update token image shape handling for svg, no need to clip * fix: bnb wallet image not displaying on receive token display * Remove svg path and render all through token image widget --- lib/src/screens/receive/widgets/qr_image.dart | 55 +++++++------------ 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/lib/src/screens/receive/widgets/qr_image.dart b/lib/src/screens/receive/widgets/qr_image.dart index bb8c41607..3f847c33e 100644 --- a/lib/src/screens/receive/widgets/qr_image.dart +++ b/lib/src/screens/receive/widgets/qr_image.dart @@ -24,41 +24,26 @@ class QrImage extends StatelessWidget { @override Widget build(BuildContext context) { final imagePath = embeddedImagePath ?? 'assets/images/qr-cake.png'; - final isSvg = imagePath.endsWith('.svg'); + final qrSize = size ?? 100.0; + final logoSize = qrSize * 0.30; - if (isSvg) { - final qrSize = size ?? 100.0; - final logoSize = qrSize * 0.30; - - return Stack( - alignment: Alignment.center, - children: [ - qr.QrImageView( - data: data, - errorCorrectionLevel: errorCorrectionLevel, - version: version ?? qr.QrVersions.auto, - size: qrSize, - foregroundColor: foregroundColor, - backgroundColor: backgroundColor, - padding: const EdgeInsets.all(12.0), - ), - TokenImageWidget( - imageUrl: imagePath, - size: logoSize * 0.8, - ), - ], - ); - } else { - return qr.QrImageView( - data: data, - errorCorrectionLevel: errorCorrectionLevel, - version: version ?? qr.QrVersions.auto, - size: size, - foregroundColor: foregroundColor, - backgroundColor: backgroundColor, - padding: const EdgeInsets.all(12.0), - embeddedImage: AssetImage(imagePath), - ); - } + return Stack( + alignment: Alignment.center, + children: [ + qr.QrImageView( + data: data, + errorCorrectionLevel: errorCorrectionLevel, + version: version ?? qr.QrVersions.auto, + size: qrSize, + foregroundColor: foregroundColor, + backgroundColor: backgroundColor, + padding: const EdgeInsets.all(12.0), + ), + TokenImageWidget( + imageUrl: imagePath, + size: logoSize * 0.8, + ), + ], + ); } }