getArrowWidthFit method

dynamic getArrowWidthFit(
  1. Rect rect
)

Implementation

getArrowWidthFit(Rect rect) {
  if (arrowWidth < 0) {
    return 0.0;
  }
  var borderRadiusFit = getBorderRadiusFit(rect);
  var maxWidth;
  if (direction == ArrowDirection.left || direction == ArrowDirection.right) {
    maxWidth = rect.height - 2 * borderRadiusFit;
  } else {
    maxWidth = rect.width - 2 * borderRadiusFit;
  }
  if (arrowWidth > maxWidth) {
    return maxWidth;
  }
  return arrowWidth;
}