Len.max constructor
Constrains the length (number of items) to a maximum amount.
max
the maximum number of items; it must be > 0.
long
the error message if the length > max
; the default value is 'the
length cannot be > max
'.
Implementation
Len.max(int max, {String? long})
: assert(max > 0),
_lenVal = _InputLen(
(int len) => len > max ? long ?? 'the length cannot be > $max' : null,
);