toPdfGradient method

Gradient toPdfGradient()

Implementation

pw.Gradient toPdfGradient() {
  debugPrint('GradientConverter: $this');
  switch (runtimeType) {
    case const (LinearGradient):
      return (this as LinearGradient).toPdfLinearGradient();
    case const (RadialGradient):
      return (this as RadialGradient).toPdfRadialGradient();
    // not supported by pdf package:
    // - SweepGradient
    default:
      throw Exception('Unsupported Gradient: $this');
  }
}