PdfAnnotationBorder constructor Null safety

PdfAnnotationBorder(
  1. [double? borderWidth,
  2. double? horizontalRadius,
  3. double? verticalRadius,
  4. PdfBorderStyle? borderStyle,
  5. int? dashArray]
)

Initializes a new instance of the PdfAnnotationBorder class with specified border width, horizontal and vertical radius.

The borderStyle and dashArray only used for shape annotations.

Implementation

PdfAnnotationBorder(
    [double? borderWidth,
    double? horizontalRadius,
    double? verticalRadius,
    PdfBorderStyle? borderStyle,
    int? dashArray]) {
  _array._add(_PdfNumber(0));
  _array._add(_PdfNumber(0));
  _array._add(_PdfNumber(1));
  this.horizontalRadius = horizontalRadius ??= 0;
  width = borderWidth ??= 1;
  this.verticalRadius = verticalRadius ??= 0;
  _borderStyle = borderStyle ??= PdfBorderStyle.solid;
  _dictionary._setName(
      _PdfName(_DictionaryProperties.s), _styleToString(_borderStyle));
  if (dashArray != null) {
    this.dashArray = dashArray;
  }
}