copy method

FutureOr<O?> copy(
  1. O obj
)

Creates a copy of obj.

  • The default implementation uses JSON to copy the internal data.

Implementation

FutureOr<O?> copy(O obj) {
  var json = toJson(obj);

  if (json is Map<String, dynamic>) {
    return createFromMap(json);
  }

  return null;
}