I have a map as below in Flutter/Dart.
Map currencyMap = {status: Success, currency: [{id: 1, code: AFN, currency: Afghan afghani, rate: 0.25}, {id: 2, code: EUR, currency: European euro, rate: 0.25}, {id: 3, code: CFA, currency: Franc CFA, rate: 0.25}]}
How do i extract just the codes to a list like below.
currencyList = [AFN, EUR, CFA]
2
Answers
UPDATE
Here is a more
better
version (using a map) in justone
line.Try this – old version using a loop
You can try this: