copyProperties static method

void copyProperties(
  1. dynamic dest,
  2. dynamic src
)

Copies content of one object to another object by recursively reading all properties from source object and then recursively writing them to destination object.

  • dest a destination object to write properties to.
  • src a source object to read properties from

Implementation

static void copyProperties(dest, src) {
  if (dest == null || src == null) return;

  var values = RecursiveObjectReader.getProperties(src);
  RecursiveObjectWriter.setProperties(dest, values);
}