method setValueFrom


bool setValueFrom(Object obj, Object value)

Attempts to set the value of the path from the provided object. Returns true if and only if the path was reachable and set.

Source

bool setValueFrom(Object obj, Object value) {
  var end = _segments.length - 1;
  if (end < 0) return false;
  for (int i = 0; i < end; i++) {
    if (obj == null) return false;
    obj = _getObjectProperty(obj, _segments[i]);
  }
  return _setObjectProperty(obj, _segments[end], value);
}