markAsPristine method

void markAsPristine(
  1. {bool updateParent = true}
)

Marks the control as pristine.

If the control has any children, marks all children as pristine, and recalculates the pristine status of all parent controls.

When updateParent is false, mark only this control. When true or not supplied, marks all direct ancestors. Default is true.

Implementation

void markAsPristine({bool updateParent = true}) {
  _pristine = true;

  forEachChild((control) => control.markAsPristine(updateParent: false));

  if (updateParent) {
    parent?.updatePristine(updateParent: updateParent);
  }
}