Created
November 3, 2021 13:10
-
-
Save lukas-h/efcb64e4b47821306e66716e2319d973 to your computer and use it in GitHub Desktop.
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
Future<void> main() async { | |
// List/Iterable: | |
var array = [1,2,3,4]; | |
array.forEach(print); | |
for(var item in array) { | |
print(item); | |
} | |
// Stream: | |
var stream = Stream.fromIterable(array); | |
stream.forEach(print); | |
await for(var item in stream) { | |
print(item); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment