I'm not sure I'd want a recommendation for spreads over.toSetto be in the recommended set. The only reason I lean over using the spread operator is that for non-nullable fields/variables, it is easier to use it over the.toSet()call since it would remain null if any call before it...
import"dart:collection"; void copy1(Map<String, int> from, Map<String, int> to) { for (var entry in from.entries) { to[entry.key] = entry.value; } } void copy2(Map<String, int> from, Map<String, int> to) { for (var key in from.keys) { to[key] = from[key]; } } vo...