printMultiBitmap method

  1. @override
Future<void> printMultiBitmap(
  1. List imgs, {
  2. IminPictureStyle? pictureStyle,
})
override

Implementation

@override
Future<void> printMultiBitmap(List<dynamic> imgs,
    {IminPictureStyle? pictureStyle}) async {
  Map<String, dynamic> arguments = <String, dynamic>{};
  if (pictureStyle != null) {
    if (pictureStyle.alignment != null) {
      arguments.putIfAbsent("alignment", () => pictureStyle.alignment?.index);
    }
    if (pictureStyle.width != null && pictureStyle.height != null) {
      arguments.putIfAbsent("width", () => pictureStyle.width);
      arguments.putIfAbsent("height", () => pictureStyle.height);
    }
  }
  arguments.putIfAbsent("bitmaps", () => imgs);
  if (imgs is List<Uint8List>) {
    await methodChannel.invokeMethod<void>('printMultiBitmap', arguments);
  } else {
    arguments.putIfAbsent("multiBitmap", () => 1);
    await methodChannel.invokeMethod<void>('printBitmapToUrl', arguments);
  }
}