nc-photos/lib/num_extension.dart
2021-06-23 01:05:01 +08:00

11 lines
272 B
Dart

extension NumExtension on num {
bool inRange(
num beg,
num end, {
bool isBegInclusive = true,
bool isEndInclusive = true,
}) {
return (this > beg || (isBegInclusive && this == beg)) &&
(this < end || (isEndInclusive && this == end));
}
}