Created
June 22, 2021 14:28
-
-
Save guilhermecarvalhocarneiro/c88f48c4f254cc439659b5f3bf87fee6 to your computer and use it in GitHub Desktop.
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
main() { | |
var data = [ | |
{ | |
"long_name": "77021-654", | |
"short_name": "77021-654", | |
"types": ["postal_code"] | |
}, | |
{ | |
"long_name": "Quadra 502 Sul Avenida Joaquim Teotônio Segurado", | |
"short_name": "Q. 502 Sul Avenida Joaquim Teotônio Segurado", | |
"types": ["route"] | |
}, | |
{ | |
"long_name": "Plano Diretor Sul", | |
"short_name": "Plano Diretor Sul", | |
"types": ["political", "sublocality", "sublocality_level_1"] | |
}, | |
{ | |
"long_name": "Palmas", | |
"short_name": "Palmas", | |
"types": ["administrative_area_level_2", "political"] | |
}, | |
{ | |
"long_name": "Tocantins", | |
"short_name": "TO", | |
"types": ["administrative_area_level_1", "political"] | |
}, | |
{ | |
"long_name": "Brasil", | |
"short_name": "BR", | |
"types": ["country", "political"] | |
} | |
]; | |
var cep = data.firstWhere((element) => element["types"].toString().contains("postal_code")); | |
print(cep); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment