Created
November 12, 2021 01:19
-
-
Save felipecastrosales/e3f0c178f858cba22c344b4d86766996 to your computer and use it in GitHub Desktop.
Maps Funções
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
Map<String, dynamic> mapa = { | |
'nome': 'Felipe', | |
'numero': 40028922, | |
}; | |
print(mapa); | |
print(mapa.length); | |
print(mapa.keys); | |
print(mapa.values); | |
mapa.forEach((key, value) { | |
print('Key: $key | Value: $value'); | |
}); | |
mapa.entries.forEach((e) { | |
print('Key: ${e.key} | Value: ${e.value}'); | |
}); | |
mapa.update('nome', (value) => 'Paulo Victor'); | |
print(mapa); | |
mapa.remove('numero'); | |
print(mapa); | |
mapa.addAll({'sobrenome': 'Silva'}); | |
print(mapa); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment