You theMap dataType is Map<String, Map<String, Map<String, String>>>.
You can directly get inner map like
theMap["first"]?["second"]
void main(List<String> args) {
Map<String, Map<String, Map<String, String>>> theMap = {
"first": {
"second": {"third": "fourth"}
}
};
print(theMap["first"]); //{second: {third: fourth}}
print(theMap["first"]?.keys.toString()); // set:=> second
print(theMap["first"]?.values.toString());// set=> {third: fourth}
print(theMap["first"]?["second"]); //{third: fourth}
}
Or like
void main(List<String> args) {
Map<String, Map<String, Map<String, String>>> theMap = {
"first": {
"second": {"third": "fourth"}
}
};
theMap.forEach((key, value) {
// for top level (first)
print("First layer key: $key");
print("First layer value: $value");
value.forEach((key, value) {
//second layer
print("Second layer key: $key");
print("Second layer value: $value");
value.forEach((key, value) {
print("Thired layer key: $key");
print("Thired layer value: $value");
});
});
});
}
And result
First layer key: first
First layer value: {second: {third: fourth}}
Second layer key: second
Second layer value: {third: fourth}
Thired layer key: third
Thired layer value: fourth