How to deep copy / clone a state varibale?

Hi there,
In my app, I want to add functionality for creating new objects by copying existing ones - cloning.
Existing ones are stored in AppState, so simple reassignment doesn't work as needed since it is stored in state and changing new object result in changing the old object as well.

Is there any way to deep copy the object?

I could not find Dart docs for it, but all modern languages have deep copy by default or libruaries. I really don't want to manually iterate through, since it has multiple nested Data Types and iteration looks too straightforward, comutity should have solved this

4
1 reply