getEvents method
Get a stream of all SDL events.
A pause of duration
will be awaited between calls to pollEvent.
Implementation
Stream<Event> getEvents({final Duration duration = Duration.zero}) async* {
while (true) {
final event = pollEvent();
if (event != null) {
yield event;
}
await Future<void>.delayed(duration);
}
}