toPdfBoxShape method

BoxShape toPdfBoxShape()

Converts the OutlinedBorder to a pw.BoxShape.

Implementation

pw.BoxShape toPdfBoxShape() {
  switch (runtimeType) {
    case CircleBorder:
      return pw.BoxShape.circle;
    case StadiumBorder:
      return pw.BoxShape.circle;
    case RoundedRectangleBorder:
      return pw.BoxShape.rectangle;
    case BeveledRectangleBorder:
      return pw.BoxShape.rectangle;
    case ContinuousRectangleBorder:
      return pw.BoxShape.rectangle;
    // unsupported by pdf package:
    // - StadiumBorder
    // - RoundedRectangleBorder
    // - BeveledRectangleBorder
    // - ContinuousRectangleBorder
    default:
      debugPrint(
          'Unsupported OutlinedBorder: $this; defaulting to rectangle border shape');
      return pw.BoxShape.rectangle;
  }
}