serialize method

Map serialize(
  1. bool withChildren
)

Implementation

Map serialize(bool withChildren) {
  var rslt = <String, dynamic>{};
  configs.forEach((key, dynamic val) {
    rslt[key] = val;
  });

  attributes.forEach((key, val) {
    rslt[key] = val;
  });

  children.forEach((key, val) {
    if (withChildren) {
      if (val is LocalNodeImpl) {
        rslt[key] = val.serialize(true);
      } else {
        rslt[key] = val.getSimpleMap();
      }
    }
  });

  return rslt;
}