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
David Adegoke committed
Jun 3, 2026 at 16:44 UTC
52c380a4554d798d61ca483d98183cf69356568f
1 file changed
+20
-35
lib/src/screens/receive/widgets/qr_image.dart
+20
-35
@@ -24,41 +24,26 @@ class QrImage extends StatelessWidget {
24
@override
25
Widget build(BuildContext context) {
26
final imagePath = embeddedImagePath ?? 'assets/images/qr-cake.png';
27
- final isSvg = imagePath.endsWith('.svg');
27
+ final qrSize = size ?? 100.0;
28
+ final logoSize = qrSize * 0.30;
29
29
- if (isSvg) {
30
- final qrSize = size ?? 100.0;
31
- final logoSize = qrSize * 0.30;
32
-
33
- return Stack(
34
- alignment: Alignment.center,
35
- children: [
36
- qr.QrImageView(
37
- data: data,
38
- errorCorrectionLevel: errorCorrectionLevel,
39
- version: version ?? qr.QrVersions.auto,
40
- size: qrSize,
41
- foregroundColor: foregroundColor,
42
- backgroundColor: backgroundColor,
43
- padding: const EdgeInsets.all(12.0),
44
- ),
45
- TokenImageWidget(
46
- imageUrl: imagePath,
47
- size: logoSize * 0.8,
48
- ),
49
- ],
50
- );
51
- } else {
52
- return qr.QrImageView(
53
- data: data,
54
- errorCorrectionLevel: errorCorrectionLevel,
55
- version: version ?? qr.QrVersions.auto,
56
- size: size,
57
- foregroundColor: foregroundColor,
58
- backgroundColor: backgroundColor,
59
- padding: const EdgeInsets.all(12.0),
60
- embeddedImage: AssetImage(imagePath),
61
- );
62
- }
30
+ return Stack(
31
+ alignment: Alignment.center,
32
+ children: [
33
+ qr.QrImageView(
34
+ data: data,
35
+ errorCorrectionLevel: errorCorrectionLevel,
36
+ version: version ?? qr.QrVersions.auto,
37
+ size: qrSize,
38
+ foregroundColor: foregroundColor,
39
+ backgroundColor: backgroundColor,
40
+ padding: const EdgeInsets.all(12.0),
41
+ ),
42
+ TokenImageWidget(
43
+ imageUrl: imagePath,
44
+ size: logoSize * 0.8,
45
+ ),
46
+ ],
47
+ );
48
}
49
}