Skip to content

Instantly share code, notes, and snippets.

@MelvinRB27
Created October 6, 2023 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MelvinRB27/4cb0501ce2f78fc8177553276bf70484 to your computer and use it in GitHub Desktop.
Save MelvinRB27/4cb0501ce2f78fc8177553276bf70484 to your computer and use it in GitHub Desktop.
Stream
void main() {
emit().listen((value){
print('Valor: $value');
});
}
Stream<int> emit(){
return Stream.periodic(Duration(seconds: 1), (value){
return value;
}).take(5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment