printText method
Future<void>
printText(
- String text, {
- PTextAlign align = PTextAlign.left,
- PTextAttribute attribute = PTextAttribute.normal,
- PTextW width = PTextW.w1,
- PTextH height = PTextH.h1,
override
Sends a text to be printed by the printer.
Parameters:
text
The text content to print.align
Text alignment (default is PTextAlign.left).attribute
Text attribute like bold or underline.width
Text width multiplier.height
Text height multiplier.
Implementation
@override
Future<void> printText(
String text, {
PTextAlign align = PTextAlign.left,
PTextAttribute attribute = PTextAttribute.normal,
PTextW width = PTextW.w1,
PTextH height = PTextH.h1,
}) async {
final args = {
'text': text,
'align': align.index,
'attribute': attribute.index,
'width': width.index,
'height': height.index,
};
await methodChannel.invokeMethod<void>('printText', args);
}