Data.copy constructor

Data.copy(
  1. dynamic target, {
  2. required String path,
  3. required dynamic from,
  4. required String fromPath,
})

A handy shortcut to copy data quickly is the Data.copy constructor, which just copies a property from one path to another.

Implementation

Data.copy(
  this.target, {
  required this.path,
  required dynamic from,
  required String fromPath,
}) : _subcommand = 'modify' {
  handleTarget(target);
  modify = DataModify.set(from, fromPath: fromPath);
}