toPdfBorderRadius method

BorderRadius toPdfBorderRadius()

Converts the OutlinedBorder to a pw.BorderRadius.

Implementation

pw.BorderRadius toPdfBorderRadius() {
  switch (runtimeType) {
    case CircleBorder:
      return pw.BorderRadius.circular(1000);
    case StadiumBorder:
      return pw.BorderRadius.circular(10);
    case RoundedRectangleBorder:
      return ((this as RoundedRectangleBorder).borderRadius as BorderRadius)
          .toPdfBorderRadius();
    case BeveledRectangleBorder:
      return ((this as BeveledRectangleBorder).borderRadius as BorderRadius)
          .toPdfBorderRadius();
    case ContinuousRectangleBorder:
      return ((this as ContinuousRectangleBorder).borderRadius
              as BorderRadius)
          .toPdfBorderRadius();
    default:
      debugPrint(
          'Unsupported OutlinedBorder: $this; defaulting to circular border radius');
      return pw.BorderRadius.circular(1000);
  }
}