performLayout method

dynamic performLayout(
  1. PrinterConstraints constraints,
  2. PrinterCanvas canvas
)
override

布局

Implementation

performLayout(PrinterConstraints constraints, PrinterCanvas canvas) {
  super.performLayout(constraints, canvas);
  List<List<bool>>? image = this.getValue(dataSource);
  if (image != null && image.length > 0) {
    double imageWidth = image[0].length.toDouble();
    actualSize = PrinterSize(imageWidth, image.length.toDouble());
  }
}