notBlank<T> static method

FormeValidator<T> notBlank<T>({
  1. String errorText = '',
})

when valid

  1. value is null
  2. value's length(after trim) > 0

Implementation

static FormeValidator<T> notBlank<T>({String errorText = ''}) {
  return (f, T v) {
    if (v == null) {
      return null;
    }
    return (v as String).trim().isNotEmpty ? null : errorText;
  };
}