printQrCode method
Future<bool>
printQrCode({
- required String data,
- int width = 200,
- int height = 200,
- bool showText = true,
- int fontSize = 16,
- int align = 1,
- int paperWidth = 52,
- bool isLabel = false,
- bool tear = true,
override
Print QR code
Implementation
@override
Future<bool> printQrCode({
required String data,
int width = 200,
int height = 200,
bool showText = true,
int fontSize = 16,
int align = 1,
int paperWidth = 52,
bool isLabel = false,
bool tear = true,
}) async {
try {
final result = await methodChannel.invokeMethod<bool>(
'printQrCode',
{
'data': data,
'width': width,
'height': height,
'showText': showText,
'fontSize': fontSize,
'align': align,
'paperWidth': paperWidth,
'isLabel': isLabel,
'tear': tear,
},
);
return result ?? false;
} catch (e) {
debugPrint('Error printing QR code: $e');
return false;
}
}