operator []= method
Sets the value at the given index
in the list to value
.
The index
must be a valid index of this list,
which means that index
must be non-negative and
less than length.
Implementation
@override
void operator []=(int index, value) {
Type type;
if (typesMap.containsKey(value.runtimeType.toString())) {
type = typesMap[value.runtimeType.toString()]!;
_value[index] = RadTypes.instance(type, value, {});
} else if (typesList.contains(value.runtimeType)) {
type = value.runtimeType;
} else {
type = RadError;
throw RadError(
'RadArray', '[]=', '${value.runtimeType} is not a valid type');
}
_value[index] = RadTypes.instance(type, value, {});
}