save method

Map save({
  1. bool includeValue = true,
})

Implementation

Map save({bool includeValue = true}) {
  var map = {};
  map.addAll(configs);
  map.addAll(attributes);
  for (var key in children.keys) {
    var node = children[key];
    map[key] = node is RemoteNode ? node.save() : node?.getSimpleMap();
  }

  if (includeValue &&
      _subscribeController != null &&
      _subscribeController?._lastUpdate != null) {
    map['?value'] = _subscribeController?._lastUpdate?.value;
    map['?value_timestamp'] = _subscribeController?._lastUpdate?.ts;
  }

  return map;
}