getOuterPath method
Create a Path that describes the outer edge of the border.
This path must not cross the path given by getInnerPath for the same Rect.
To obtain a Path that describes the area of the border itself, set the Path.fillType of the returned object to PathFillType.evenOdd, and add to this object the path returned from getInnerPath (using Path.addPath).
The textDirection argument must be provided non-null if the border
has a text direction dependency (for example if it is expressed in terms
of "start" and "end" instead of "left" and "right"). It may be null if
the border will not need the text direction to paint itself.
See also:
- getInnerPath, which creates the path for the inner edge.
- Path.contains, which can tell if an Offset is within a Path.
Implementation
@override
Path getOuterPath(Rect rect, {TextDirection? textDirection}) {
rect = Rect.fromPoints(rect.topLeft, rect.bottomRight - const Offset(0, 10)); // 화살표 크기를 절반으로 줄이기 위해 rect 수정
return Path()
..addRRect(RRect.fromRectAndRadius(rect, Radius.circular(rect.height / 3)))
..moveTo(rect.bottomCenter.dx - 5, rect.topCenter.dy) // 화살표 시작점을 변경하고 크기를 줄임
..relativeLineTo(5, -10) // 위로 이동
..relativeLineTo(5, 10) // 아래로 이동
..close();
}