markAsEnabled method
Enables the control. This means the control is included in validation checks and the aggregate value of its parent. Its status recalculates based on its value and its validators.
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), valueChanges
and statusChanged events are emitted if value or status change.
Otherwise the control update this values but none of this events are
emitted.
Implementation
void markAsEnabled({bool updateParent = true, bool emitEvent = true}) {
if (enabled) {
return;
}
_status = ControlStatus.valid;
updateValueAndValidity(updateParent: true, emitEvent: emitEvent);
_updateAncestors(updateParent);
}