getPolygonBound method Null safety
Get all the boundary of the polygon
Implementation
static List<Point> getPolygonBound(List<Point> polygon) {
assert(polygon.length >= 3);
Set<Point> list = {};
list.add(getMostLeftPoint(polygon));
list.add(getTopPoint(polygon));
list.add(getMostRightPoint(polygon));
list.add(getBottomPoint(polygon));
return list.toList();
}