bezierTo method

void bezierTo({
  1. required Offset target,
  2. Offset? control1,
  3. Offset? control2,
  4. DrawPaint paint = const DrawPaint(),
})

Add bezier curve.

If the control1 and control2 are null, the mothod will use lineTo.

If control2 is null, will use bezier2To.

If control1 and control2 are not null, will use bezier3To.

Implementation

void bezierTo({
  required Offset target,
  Offset? control1,
  Offset? control2,
  DrawPaint paint = const DrawPaint(),
}) {
  if (control1 == null) {
    lineTo(target);
    return;
  }
  if (control2 == null) {
    bezier2To(target, control1);
    return;
  }
  bezier3To(target, control1, control2);
}