Skip to content

Instantly share code, notes, and snippets.

@bakate
Created May 8, 2022 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakate/11e7ed79e7a79a909b3c06b97e7ec377 to your computer and use it in GitHub Desktop.
Save bakate/11e7ed79e7a79a909b3c06b97e7ec377 to your computer and use it in GitHub Desktop.
How to create a list in Dart
const myList = ["Simon", "Brieuc", "Romain", "Antoine a.k.a DJ Dragon", "Aurel", "Séb", "Nadhir", "Carl", "Rachida", "Julien"];
void main() {
myList.forEach(displayElement);
}
void displayElement(String element) {
print(element.toUpperCase());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment