Skip to content

Instantly share code, notes, and snippets.

@kikuchy
Created May 15, 2019 08:04
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 kikuchy/1e17e0a336a933b98b8daf795b6325bf to your computer and use it in GitHub Desktop.
Save kikuchy/1e17e0a336a933b98b8daf795b6325bf to your computer and use it in GitHub Desktop.
Collection If/For (from Dart 2.3) also can be used in Set literal! πŸŽ‰
enum Hoge {
hoge, fuga, moge, piyo,
}
void main() {
Set s = {
for (Hoge h in Hoge.values)
if (h != Hoge.hoge) h
};
print(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment