length property

double get length

Total length of the polyline (sum of all segment lengths)

Implementation

double get length {
  double total = 0;
  for (int i = 0; i < points.length - 1; i++) {
    total += points[i].distanceTo(points[i + 1]);
  }
  return total;
}