required method

Input required([
  1. bool r = true
])

Implementation

Input required([bool r = true]) {
  if (r) attr('required', BooleanAttribute(true));
  return this;
}