Understanding the difference between deep and shallow copying When you create a collection in Dart, the contents of the collection are mutable. You can see that in the following example: final myList = ['sheep', 'cow'];
myList.add('horse'); // [sheep, cow, horse]
myList.remove('cow'); // [sheep, horse]
myList[0] = 'goat'; // [goat, horse] …