paintTable method

void paintTable(
  1. Context context,
  2. PdfRect box, [
  3. List<double?>? widths,
  4. List<double>? heights,
])

Implementation

void paintTable(Context context, PdfRect box,
    [List<double?>? widths, List<double>? heights]) {
  super.paint(context, box);

  if (verticalInside.style.paint) {
    verticalInside.style.setStyle(context);
    var offset = box.x;
    for (final width in widths!.sublist(0, widths.length - 1)) {
      offset += width!;
      context.canvas.moveTo(offset, box.y);
      context.canvas.lineTo(offset, box.top);
    }
    context.canvas.setStrokeColor(verticalInside.color);
    context.canvas.setLineWidth(verticalInside.width);
    context.canvas.strokePath();

    verticalInside.style.unsetStyle(context);
  }

  if (horizontalInside.style.paint) {
    horizontalInside.style.setStyle(context);
    var offset = box.top;
    for (final height in heights!.sublist(0, heights.length - 1)) {
      offset -= height;
      context.canvas.moveTo(box.x, offset);
      context.canvas.lineTo(box.right, offset);
    }
    context.canvas.setStrokeColor(horizontalInside.color);
    context.canvas.setLineWidth(horizontalInside.width);
    context.canvas.strokePath();
    horizontalInside.style.unsetStyle(context);
  }
}