printEscPosText method

  1. @override
Future<void> printEscPosText(
  1. String text, {
  2. IminEscPosTextStyle? style,
})
override

Implementation

@override
Future<void> printEscPosText(String text,
    {IminEscPosTextStyle? style}) async {
  Map<String, dynamic> arguments = <String, dynamic>{"text": text};
  if (style != null) {
    if (style.widthMultiple != null) {
      arguments['widthMultiple'] = style.widthMultiple;
    }
    if (style.heightMultiple != null) {
      arguments['heightMultiple'] = style.heightMultiple;
    }
    if (style.bold != null) arguments['bold'] = style.bold;
    if (style.italic != null) arguments['italic'] = style.italic;
    if (style.antiWhite != null) arguments['antiWhite'] = style.antiWhite;
    if (style.underline != null) arguments['underline'] = style.underline;
    if (style.lineSpacing != null) {
      arguments['lineSpacing'] = style.lineSpacing;
    }
    if (style.charSpace != null) arguments['charSpace'] = style.charSpace;
    if (style.align != null) arguments['align'] = style.align!.index;
  }
  await methodChannel.invokeMethod<void>('printEscPosText', arguments);
}