operator []= method
Sets the value of a nested field by name.
Parameters:
name
: The name of the nested field.value
: The new value to set.
Throws:
Exception
if the field does not exist.
Implementation
operator []=(String name, value) {
assert(rawValue != null);
if (rawValue == null) {
throw Exception("Field $name does not exist");
}
for (final field in rawValue!.fields) {
if (field.fieldName == name) {
field.value = value;
return;
}
}
throw Exception("Field $name does not exist");
}