getPoint static method

GPoint getPoint([
  1. double x = 0,
  2. double y = 0
])

Get a GPoint instance from the pool. If the pool is empty, a new GPoint object is created and returned.

Implementation

static GPoint getPoint([double x = 0, double y = 0]) {
  if (_points.isEmpty) {
    return GPoint(x, y);
  }
  return _points.removeLast()
    ..x = x
    ..y = y;
}