Clone a List, Map or Set in Dart
Use of clone() in Java is tricky and questionable1,2. Effectively, clone() is a copy constructor and for that, the Dart List, Map and Set types each have a named constructor named .from() that perform a shallow copy; e.g. given these declarations Map<String, int> numMoons, moreMoons; numMoons = const <String,int>{ ‘Mars’ : 2, ‘Jupiter’ : 27 … Read more