Search code examples
objectcopyclonedart

How can I clone an Object (deep copy) in Dart?


Is there a Language supported way to make a full (deep) copy of an Object in Dart?

If multiple options exist, what are their differences?


Solution

  • No as far as open issues seems to suggest:

    https://github.com/dart-lang/sdk/issues/3367

    And specifically:

    ... Objects have identity, and you can only pass around references to them. There is no implicit copying.