between method
bool
between(
- int min,
- int max, {
- bool startInclusive = true,
- bool endInclusive = true,
})
Implementation
bool between(
int min,
int max, {
bool startInclusive = true,
bool endInclusive = true,
}) {
if (this == null) return false;
if (startInclusive && endInclusive) return this! >= min && this! <= max;
if (!startInclusive && endInclusive) return this! > min && this! <= max;
if (startInclusive && !endInclusive) return this! >= min && this! < max;
if (!startInclusive && !endInclusive) return this! > min && this! < max;
return false;
}