val method

dynamic val(
  1. String path, [
  2. dynamic value = unspecified
])

If only path is specified, this method fetches the value of the node at the given path. If value is also specified, it will set the value of the node at the given path to the specified value, and return that value.

Implementation

dynamic val(String path, [dynamic value = unspecified]) {
  if (value is Unspecified) {
    return this[path]!.lastValueUpdate!.value!;
  } else {
    updateValue(path, value);
    return value;
  }
}