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

Darts built-in collections use a named constructor called “from” to accomplish this. See this post: Clone a List, Map or Set in Dart

Map mapA = {
    'foo': 'bar'
};
Map mapB = new Map.from(mapA);

Leave a Comment