overlaps method

bool overlaps(
  1. num left,
  2. num right
)

Returns true if the interval defined by the points left and right overlaps this.

Implementation

bool overlaps(num left, num right) {
  final start = min(left, right);
  final end = max(left, right);
  if (end < this.start) return false;
  if (start > this.end) return false;
  return true;
}