overlaps method Null safety

bool overlaps(
  1. Interval other
)

Implementation

bool overlaps(Interval other) {
  bool result;
  if (this == other) {
    result = true;
  } else if (other.comes_before(this)) {
    result = other.overlaps(this);
  } else if (other.lowerBound < this.upperBound) {
    result = true;
  } else if (other.lowerBound == this.upperBound) {
    result = other.lowerClosed && this.upperClosed;
  } else {
    result = false;
  }
  return result;
}