required property

bool get required

Implementation

bool get required => _required;
  1. @Input()
set required (bool required)

Whether or not the input is required.

If there's no input text, a required input will show a validation error when it's first blured.

Implementation

@Input()
set required(bool required) {
  var prev = _required;
  _required = required;
  if (prev != _required) {
    // Required value changed and we are using a control. Force revalidation
    // on the control.
    _cd?.control?.updateValueAndValidity();
  }
}