addTip method

ArrowTip addTip({
  1. double? tipLength,
  2. TipSide side = TIP_AT_END,
})

Implementation

ArrowTip addTip({
  double? tipLength,
  TipSide side = TIP_AT_END,
}) {
  tipLength ??= getDefaultTipLength();

  var tip = createTip(tipLength: tipLength, side: side);

  resetEndpointsBasedOnTip(
    tip,
    side,
  );

  if (side == TIP_AT_START) {
    startTip = tip;
  } else {
    endTip = tip;
  }

  add([tip]);

  return tip;
}