markAsPending method

void markAsPending({
  1. bool updateParent = true,
  2. bool emitEvent = true,
})

Marks the control as pending.

A control is pending while the control performs async validation.

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

When emitEvent is true or not supplied (the default), a statusChanged event is emitted.

Implementation

void markAsPending({bool updateParent = true, bool emitEvent = true}) {
  _status = ControlStatus.pending;

  if (emitEvent) {
    this._statusChanges.add(_status);
  }

  if (updateParent) {
    parent?.markAsPending(updateParent: updateParent, emitEvent: emitEvent);
  }
}