printText method

  1. @override
Future<String> printText(
  1. String text,
  2. PrintStyle printStyle
)
override

Implementation

@override
Future<String> printText(String text, PrintStyle printStyle) async {
  try {
    return await methodChannel.invokeMethod<String>('printText', {
          'text': text,
          'textAlign': printStyle.textAlign.value,
          'textSize': printStyle.textSize,
          'fontStyle': printStyle.fontStyle.value,
        }) ??
        'invalid';
  } on MissingPluginException catch (_) {
    throw MissingPluginException('No method found for printText() on channel');
  }
}