Traditionally, to iterate over the keys and values of a Map
you can write this:
map.forEach((key, value) {
});
But with the introduction of patterns in Dart 3.0 you could actually write it as
for (var MapEntry(:key, :value) in map.entries) {
}
In fact, such a construction is given as example at the patterns documentation in the For and for-in loops section.
I suppose whether it’s a better code style is subjective, but is one way better than the other in terms of performance/memory?