updateValue method
void
updateValue(})
override
Set the value of the AbstractControl to value
.
If onlySelf
is true
, this change will only affect the validation of
this Control
and not its parent component. This defaults to false
.
If emitEvent
is true
, this change will cause a valueChanges
event on
the Control
to be emitted. This is the default behavior.
If emitModelToViewChange
is true
, the view will be notified about the
new value via an onChange
event. This is the default behavior if
emitModelToViewChange
is not specified.
Implementation
@override
void updateValue(
List<dynamic>? value, {
bool? onlySelf,
bool? emitEvent,
bool? emitModelToViewChange,
String? rawValue,
}) {
// Treat empty and null as the same.
if (value != null && value.isEmpty) value = null;
_checkAllValuesPresent(value);
for (var i = 0; i < controls.length; i++) {
controls[i].updateValue(value == null ? null : value[i],
onlySelf: true,
emitEvent: emitEvent,
emitModelToViewChange: emitModelToViewChange);
}
updateValueAndValidity(onlySelf: onlySelf, emitEvent: emitEvent);
}