Last active
September 21, 2018 12:27
-
-
Save bergwerf/3acb9ce5fbfd5de22af893ff1dd10bf4 to your computer and use it in GitHub Desktop.
Dart WhereIterable does not cache
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
void main() { | |
final mappedIterable = ['a', 'b', 'c', 'd'].map((ch) { | |
print('mapped $ch'); | |
return ch; | |
}).where((ch) { | |
return ch != 'a'; | |
}); | |
if (mappedIterable.isNotEmpty) { | |
print('iterable is non-empty'); | |
print(mappedIterable.first); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment