Given this Map
var theMap = {"first":{"second":{"third": "fourth"}}};
I can access the first key and value like this
for (final mapEntry in theMap.entries) {
print (mapEntry.key); // prints "first"
print (mapEntry.value); //prints "{second: {third: fourth}}"
}
How can I access "second", "third" and "fourth"? I tried this
print ((mapEntry.value as MapEntry).key);
but it throws a TypeError
This works
for (final mapEntry2 in mapEntry.value.entries) {
print (mapEntry2.key); //prints "second"
}
but it seems rather cumbersome.