Created
May 15, 2019 08:04
-
-
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! π
This file contains hidden or 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
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