printQRCode static method
Print a QR code.
Convenience method for printing a QR code with customizable size.
data: Content to encode in the QR codesize: Size of the QR code (width and height)alignment: QR code alignment (left, center, right)
Returns true if printing was successful.
Implementation
static Future<bool> printQRCode(
String data, {
int size = 200,
Alignment alignment = Alignment.center,
}) async {
// QR codes typically have a 1:1 aspect ratio, so use size for both dimensions
return await printBarcode(
data,
BarcodeType.qrCode,
height: size,
width: 1, // For QR codes, width is module size
alignment: alignment,
textPosition:
BarcodeTextPosition.none, // QR codes don't have human-readable text
);
}