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
This commit is contained in:
David Adegoke
2026-06-03 17:44:19 +02:00
committed by GitHub
parent 0b4e52c5f9
commit 52c380a455
+20 -35
View File
@@ -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,
),
],
);
}
}