printTextFormatted method
Future<PrintResult>
printTextFormatted(
- String text, {
- TextAlignment alignment = TextAlignment.left,
- FontAttributes fontAttributes = const FontAttributes(),
- int fontWidth = 0,
- int fontHeight = 0,
- int fontType = 0,
- bool cutPaper = true,
override
Imprime texto com formatação
Implementation
@override
Future<PrintResult> printTextFormatted(
String text, {
TextAlignment alignment = TextAlignment.left,
FontAttributes fontAttributes = const FontAttributes(),
int fontWidth = 0,
int fontHeight = 0,
int fontType = 0,
bool cutPaper = true,
}) async {
final result = await methodChannel.invokeMethod<Map>('printTextFormatted', {
'text': text,
'alignment': alignment.value,
'fontAttributes': fontAttributes.toValue(),
'fontWidth': fontWidth,
'fontHeight': fontHeight,
'fontType': fontType,
'cutPaper': cutPaper,
});
if (result == null) {
return const PrintResult(success: false, resultCode: -1);
}
return PrintResult.fromMap(result);
}