contains method

bool contains(
  1. T value
)

Checks whether the specified value belongs to the range, is equal to start or endInclusive or lies between them

Implementation

bool contains(T value) {
  if (start.compareTo(endInclusive) <= 0) {
    return start.compareTo(value) <= 0 && value.compareTo(endInclusive) <= 0;
  } else {
    return endInclusive.compareTo(value) <= 0 && value.compareTo(start) <= 0;
  }
}