set<T> method Null safety

void set<T>(
  1. String key,
  2. T value,
  3. {bool forceUpdate = true}
)

Sets type T from objectData

To set an int, call setType

Implementation

void set<T>(String key, T value, {bool forceUpdate = true}) {
  if (_getObjectData().containsKey(key)) {
    if (_getObjectData()[key] == value && !forceUpdate) {
      return;
    }
    _getObjectData()[key] =
        ParseMergeTool().mergeWithPrevious(_unsavedChanges[key], value);
  } else {
    _getObjectData()[key] = value;
  }
  _unsavedChanges[key] = _getObjectData()[key];
}