PdfBorders constructor Null safety

PdfBorders(
  1. {PdfPen? left,
  2. PdfPen? right,
  3. PdfPen? top,
  4. PdfPen? bottom}
)

Initialize a new instance of the PdfBorders class.

Implementation

PdfBorders({PdfPen? left, PdfPen? right, PdfPen? top, PdfPen? bottom}) {
  if (left == null) {
    final PdfPen defaultBorderPenLeft = PdfPen(PdfColor(0, 0, 0));
    defaultBorderPenLeft.dashStyle = PdfDashStyle.solid;
    this.left = defaultBorderPenLeft;
  } else {
    this.left = left;
  }
  if (right == null) {
    final PdfPen defaultBorderPenRight = PdfPen(PdfColor(0, 0, 0));
    defaultBorderPenRight.dashStyle = PdfDashStyle.solid;
    this.right = defaultBorderPenRight;
  } else {
    this.right = right;
  }
  if (top == null) {
    final PdfPen defaultBorderPenTop = PdfPen(PdfColor(0, 0, 0));
    defaultBorderPenTop.dashStyle = PdfDashStyle.solid;
    this.top = defaultBorderPenTop;
  } else {
    this.top = top;
  }
  if (bottom == null) {
    final PdfPen defaultBorderPenBottom = PdfPen(PdfColor(0, 0, 0));
    defaultBorderPenBottom.dashStyle = PdfDashStyle.solid;
    this.bottom = defaultBorderPenBottom;
  } else {
    this.bottom = bottom;
  }
}