Created
July 23, 2018 15:00
-
-
Save magnatronus/8dac11163e40e29c907cdd63e3aafefe to your computer and use it in GitHub Desktop.
Dart List example
This file contains 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() { | |
List myList = List(); | |
myList.add({'title' :"Chocolate", 'isFavorite': true}); | |
myList.add({'title' :"Cucumber", 'isFavorite': false}); | |
myList.forEach( (item) { | |
print('${item['title']} ${(item['isFavorite'])?"is my favourite": "is not my favourite"}'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment