printText method
Future<bool>
printText({
- required String text,
- int size = 1,
- int align = 1,
- int paperWidth = 52,
- bool isLabel = false,
- 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;
}
}