Created with <3 with dartpad.dev.
Created
October 6, 2023 14:50
-
-
Save MelvinRB27/4cb0501ce2f78fc8177553276bf70484 to your computer and use it in GitHub Desktop.
Stream
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
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