CakeWallet/lib/src/screens/receive/widgets/qr_image.dart
cyan 17d99e5451
feat(ui): add app logo to qr code (#2072)
fix(ui): use high instead of low error correction for QR codes
2025-06-17 01:32:11 +03:00

35 lines
977 B
Dart

import 'package:cake_wallet/wallet_type_utils.dart';
import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart' as qr;
class QrImage extends StatelessWidget {
QrImage({
required this.data,
this.foregroundColor = Colors.black,
this.backgroundColor = Colors.white,
this.size = 100.0,
this.version,
this.errorCorrectionLevel = qr.QrErrorCorrectLevel.H,
});
final double size;
final Color foregroundColor;
final Color backgroundColor;
final String data;
final int? version;
final int errorCorrectionLevel;
@override
Widget build(BuildContext context) {
return qr.QrImageView(
data: data,
errorCorrectionLevel: errorCorrectionLevel,
version: version ?? qr.QrVersions.auto,
size: size,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
padding: const EdgeInsets.all(8.0),
embeddedImage: AssetImage('assets/images/qr-cake.png'),
);
}
}