Created
September 2, 2025 12:25
-
-
Save tunitowen/0a6f577a48757f54f01f571f08e79c9b to your computer and use it in GitHub Desktop.
Joii Stream Mapping
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() { | |
| getStream() | |
| .map((v) => "Something $v") | |
| .listen((v){ | |
| print(v); | |
| }); | |
| } | |
| Stream<String> getStream() async* { | |
| final list = List.generate(10, (e) => e); | |
| for (final item in list) { | |
| await Future.delayed(Duration(seconds: 1)); | |
| yield "Hello World ($item)"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment