overlaps method
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;
}