1

I need to get country name and country code into List as "Andorra (AD)". I can load json to a map but I cannot convert to List. How can I convert json map to List String?

"country": [ { "countryCode": "AD", "countryName": "Andorra", "currencyCode": "EUR", "isoNumeric": "020" },

1 Answer 1

2

You can use the .map() function

var countryList = country.map((c) => '${c["countryName"]} (${c["countryCode"]})').toList()
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.