getVertex method

Point<double> getVertex(
  1. int index
)

根据索引获取顶点

Implementation

Point<double> getVertex(int index) {
  switch (index) {
    case 0:
      return topLeft;
    case 1:
      return topRight;
    case 2:
      return bottomRight;
    case 3:
      return bottomLeft;
    default:
      throw ArgumentError('顶点索引必须在0-3之间');
  }
}