Created
April 22, 2022 16:27
-
-
Save rrousselGit/6c8d2ec110896d5218f5c9ee222875a5 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
void main() async { | |
final stream = fn(); | |
print('here'); | |
print(await stream.first); | |
print('done'); | |
} | |
Stream<int> fn() async* { | |
print('try'); | |
try { | |
while (true) { | |
print('send message'); | |
yield 1; | |
await Future.delayed(Duration(seconds: 1)); | |
} | |
} finally { | |
print('end'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment