printQrCode method

  1. @override
Future<bool> printQrCode({
  1. required String data,
  2. int width = 200,
  3. int height = 200,
  4. bool showText = true,
  5. int fontSize = 16,
  6. int align = 1,
  7. int paperWidth = 52,
  8. bool isLabel = false,
  9. 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;
  }
}