Skip to content

Instantly share code, notes, and snippets.

@code-simple
Created October 18, 2020 11:05
Show Gist options
  • Save code-simple/8952d070ef7400c900edb992314e22a1 to your computer and use it in GitHub Desktop.
Save code-simple/8952d070ef7400c900edb992314e22a1 to your computer and use it in GitHub Desktop.
How to use For Loop in Nested Map
// How to use For Loop in Nested Map
void main() {
var people = {1: {'Name': 'John', 'Age': '27', 'Sex': 'Male'},
2: {'Name': 'Marie', 'Age': '22', 'Sex': 'Female'}};
for(int i=1;i<=people.length;i++){
print('\nPerson ID: ${i}');
people[i].forEach((k,v)=>print('$k : $v'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment