Return true if x is in the interval [offset, offset + length].
true
x
[offset, offset + length]
bool contains(int x) => offset <= x && x <= offset + length;