printImage method

Future<String?> printImage(
  1. String imagePath, {
  2. String x = '10',
  3. String y = '10',
})

Prints a bitmap image from an absolute file path.

imagePath – absolute path to the image file on the device. x, y – label origin coordinates.

Implementation

Future<String?> printImage(
  String imagePath, {
  String x = '10',
  String y = '10',
}) async {
  try {
    final String? result = await _channel.invokeMethod('printImage', {
      'imagePath': imagePath,
      'x': x,
      'y': y,
    });
    return result;
  } on PlatformException catch (e) {
    throw 'Failed to print image: ${e.message}';
  }
}