getBottomPoint method Null safety

Point<num> getBottomPoint(
  1. List<Point<num>> polygon
)

Get the furthest bottom point of the polygon

Implementation

static Point getBottomPoint(List<Point> polygon) {
  assert(polygon.length >= 3);
  var bottomPoint = Point<num>(double.infinity, double.infinity);

  for (var p in polygon) {
    if (p.y < bottomPoint.y) {
      bottomPoint = p;
    }
  }

  return bottomPoint;
}