maxLength static method

BsInputValidator maxLength(
  1. int length
)

define maxLength validation

Implementation

static BsInputValidator maxLength(int length) {
  return BsInputValidator(validator: (value) {
    if (value.toString().length > length)
      return "Value cannot be more than $length";
    return null;
  });
}