Created
May 8, 2019 14:23
-
-
Save lbv/89bf5afd9bd4b2375e5d9c5d3b5d3048 to your computer and use it in GitHub Desktop.
This file contains 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
class SomeState { | |
int counter = 0; | |
Stream<int> stream() async* { | |
yield counter += 1; | |
yield counter += 1; | |
print('at the end of stream counter is $counter'); | |
} | |
} | |
void main() { | |
final state = SomeState(); | |
state.stream().listen((x) => print('received $x')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment