length method

num length()

Implementation

num length() {
  final head = this.head();
  final tail = this.tail();

  if (tail != null) {
    return tail.point.distanceTo(head.point);
  }

  return -1;
}