createContourPath static method

Path createContourPath(
  1. Rect rect
)

Implementation

static Path createContourPath(Rect rect) {
  const Radius radius = Radius.circular(8);
  final path = Path();

  path.moveTo(rect.left + radius.x, rect.top);

  path.lineTo(rect.right - radius.x, rect.top);
  path.arcToPoint(Offset(rect.right, rect.top + radius.y),
      radius: radius, clockwise: true);

  path.lineTo(rect.right, rect.bottom - radius.y);
  path.arcToPoint(Offset(rect.right - radius.x, rect.bottom),
      radius: radius, clockwise: true);
  path.lineTo(rect.left + radius.x, rect.bottom);
  path.arcToPoint(Offset(rect.left, rect.bottom - radius.y),
      radius: radius, clockwise: true);
  path.lineTo(rect.left, rect.top + radius.y);
  path.arcToPoint(Offset(rect.left + radius.x, rect.top),
      radius: radius, clockwise: true);

  path.close();

  return path;
}