isValid method
Checks whether a non-empty value satisfies the validation criteria.
Override this in subclasses with the specific validation logic. It is never called with empty input — call resolves that beforehand.
Implementation
@override
bool isValid(String value) => value.trim().runes.length <= max;