operator []= method

void operator []=(
  1. String key,
  2. dynamic value
)

Sets key to value.

Implementation

operator []=(String key, dynamic value) {
  if (isNullOrEmpty(key)) {
    throw ArgumentError.notNull(key);
  }
  if (key.startsWith('_')) {
    throw new ArgumentError('key should not start with \'_\'');
  }
  if (key == 'objectId' ||
      key == 'createdAt' ||
      key == 'updatedAt' ||
      key == 'className') {
    throw new ArgumentError('$key is reserved by LeanCloud');
  }
  _LCSetOperation op = new _LCSetOperation(value);
  _applyOperation(key, op);
}