printText method

  1. @override
Future<bool> printText({
  1. required String text,
  2. int size = 1,
  3. int align = 1,
  4. int paperWidth = 52,
  5. bool isLabel = false,
  6. bool tear = true,
})
override

Print text

Implementation

@override
Future<bool> printText({
  required String text,
  int size = 1,
  int align = 1,
  int paperWidth = 52,
  bool isLabel = false,
  bool tear = true,
}) async {
  try {
    final result = await methodChannel.invokeMethod<bool>(
      'printText',
      {
        'text': text,
        'size': size,
        'align': align,
        'paperWidth': paperWidth,
        'isLabel': isLabel,
        'tear': tear,
      },
    );
    return result ?? false;
  } catch (e) {
    debugPrint('Error printing text: $e');
    return false;
  }
}