Skip to content

Instantly share code, notes, and snippets.

@y9c
Last active March 8, 2020 17:29
Show Gist options
  • Save y9c/540d15e9a25afb2159ee1b380e98d906 to your computer and use it in GitHub Desktop.
Save y9c/540d15e9a25afb2159ee1b380e98d906 to your computer and use it in GitHub Desktop.
list comprehension by dart
void main() {
print([
if (2 > 1) 222 else 333,
if (2 > 3) 444,
for (int i in Iterable.generate(10)) if (i % 3 == 1) i,
for (int i in Iterable.generate(10, (x) => x + 100)) if (i % 2 == 0) i
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment