Skip to content

Instantly share code, notes, and snippets.

@abdorll
Created August 8, 2023 02:07
Show Gist options
  • Save abdorll/e6fe05e4b51b8ed62f01012c105d0737 to your computer and use it in GitHub Desktop.
Save abdorll/e6fe05e4b51b8ed62f01012c105d0737 to your computer and use it in GitHub Desktop.
glistening-waterfall-8952

glistening-waterfall-8952

Created with <3 with dartpad.dev.

void main() {
// Create a string and an element.
String string = "hello";
String element = "l";
// Create a list to store the element.
List<String> list = [];
// Append the element to the list 4 times.
for (int i = 0; i < 4; i++) {
list.add(element);
}
// Print the list.
print(list);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment