bool matches({required int length}) { if (kIsWeb || length < minLength) { return false; } final maxLength = this.maxLength; return maxLength == null || length < maxLength; }