drawQRCode method
Implementation
Future<void> drawQRCode(Canvas canvas, Size size, QrCode qrCode, Paint paint, double pixelSize) async {
for (var x = 0; x < qrCode.moduleCount; x++) {
for (var y = 0; y < qrCode.moduleCount; y++) {
var isDark = QrImage(qrCode).isDark(y, x);
if (isDark) {
// Check if the current module is not overlapped by the image
if (image == null || !isImagePixel(x, y, size)) {
Rect rect = Rect.fromLTWH(x.toDouble() * pixelSize, y.toDouble() * pixelSize, pixelSize, pixelSize);
canvas.drawRect(rect, paint);
}
}
}
}
}