Skip to content

Instantly share code, notes, and snippets.

@krishnakumarcn
Last active March 30, 2022 09:15
Show Gist options
  • Save krishnakumarcn/c78b6727f62b7a8fdad6acc575a3c3b1 to your computer and use it in GitHub Desktop.
Save krishnakumarcn/c78b6727f62b7a8fdad6acc575a3c3b1 to your computer and use it in GitHub Desktop.
Yield
void main() {
yieldTester().listen((String test) => print(test));
}
Stream<String> yieldTester() async*{
yield "RSC";
yield* test();
yield "was here";
}
Stream<String> test()async*{
yield "dMerchant";
await Future.delayed(Duration(seconds: 1));
yield "flutter";
yield "team";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment