printString method
Future<int>
printString(
- String text, {
- ElginAlign align = ElginAlign.LEFT,
- @Deprecated('Não tem efeito real nas impressoras Elgin e será removido em versões futuras.') bool isBold = false,
- @Deprecated('Não tem efeito real nas impressoras Elgin e será removido em versões futuras.') bool isUnderline = false,
- ElginFont font = ElginFont.FONTA,
- ElginSize fontSize = ElginSize.MD,
*printString
Just print a string in your paper with some align, fontSize, font and some others things
Implementation
Future<int> printString(
String text, {
ElginAlign align = ElginAlign.LEFT,
@Deprecated(
'Não tem efeito real nas impressoras Elgin e será removido em versões futuras.',
)
bool isBold = false,
@Deprecated(
'Não tem efeito real nas impressoras Elgin e será removido em versões futuras.',
)
bool isUnderline = false,
ElginFont font = ElginFont.FONTA,
ElginSize fontSize = ElginSize.MD,
}) async {
await reset();
Map<String, dynamic> mapParam = {};
mapParam['text'] = text;
mapParam['align'] = align.value;
mapParam['font'] = font.value;
mapParam['fontSize'] = fontSize.value;
int? print =
await platform?.invokeMethod('printText', {"textArgs": mapParam}) ??
9999;
if (print < 0) {
throw ElginException(print);
}
feed(1);
return print;
}