getDescription method

  1. @override
String getDescription()
override

Implementation

@override
String getDescription() {
  String message = 'Value must be a valid string';

  if (_length > 0) {
    message += ' and no longer than $_length chars';
  }

  if (_allowList.isNotEmpty) {
    message += ' and only consist of \'${_allowList.join(",")}\' chars';
  }

  return message;
}