roundedDropdownPath method

Path roundedDropdownPath(
  1. Rect rect
)

Implementation

Path roundedDropdownPath(Rect rect) {
  final calcTriangleHeight = isTriangleDown ? 0 : triangle.height;

  rect = Rect.fromLTWH(rect.topLeft.dx, rect.topLeft.dy + calcTriangleHeight,
      rect.width, rect.height);

  final path = Path();
  _drawTopLeftCorner(path, rect);

  if (triangle.width > 0 && triangle.height > 0) {
    if (!isTriangleDown) {
      _drawTriangleUp(
          path: path,
          boxRect: rect.shift(Offset(0, -triangle.height)),
          trianglePosition: _calcArrowPosition(rect.width),
          triangle: triangle);
    }
  }
  _drawTopRightCorner(path, rect);
  _drawBottomRightCorner(path, rect);

  if (triangle.width > 0 && triangle.height > 0) {
    if (isTriangleDown) {
      _drawTriangleDown(
          path: path,
          boxRect: rect,
          trianglePosition: _calcArrowPosition(rect.width),
          triangle: triangle);
    }
  }

  _drawBottomLeftCorner(path, rect);
  return path;
}