dashPattern property

List<double> get dashPattern

Gets or sets the dash pattern of the pen.

//Create a new PDF document.
PdfDocument document = PdfDocument()
  ..pages.add().graphics.drawRectangle(
      //Set pen dash pattern.
      pen: PdfPen(PdfColor(255, 0, 0))..dashPattern = [4, 2, 1, 3],
      bounds: Rect.fromLTWH(10, 10, 200, 100));
//Save the document.
List<int> bytes = await document.save();
//Close the document.
document.dispose();

Implementation

List<double> get dashPattern => _dashPattern;
set dashPattern (List<double> value)

Implementation

set dashPattern(List<double> value) {
  if (dashStyle == PdfDashStyle.solid) {
    UnsupportedError(
        'This operation is not allowed. Set Custom dash style to change the pattern.');
  }
  _checkImmutability();
  _dashPattern = value;
}