Cloning lists, maps, and sets in Dart

Understanding the difference between deep and shallow copying

Photo by Kelly Sikkema

When you create a collection in Dart, the contents of the collection are mutable. You can see that in the following example: