Len.range constructor
Constrains the length (number of items) within the range min–max
.
min
the lower limit; it must be > 0 and < max
.
max
the upper limit; it must be > 0 and > min
.
short
the error message if the length < min
; the default value is 'the
length cannot be < min
'
long
the error message if the length > max
; the default value is 'the
length cannot be > max
'.
Implementation
Len.range(int min, int max, {String? short, String? long})
: assert(min < max),
_lenVal = Pair(
Len.min(min, short: short).call,
Len.max(max, long: long).call,
).call;