'Periodic Stream with debounceTime emits nothing

I have a periodic stream that emits every second. I want to reduce the emit frequency with debounceTime of two seconds, so I can get something like: [2, 4, 6 ...], but instead I get no events.

Stream.periodic(Duration(seconds: 1), (count) => '$count')
  .debounceTime(Duration(seconds: 2))
  .listen(print); // prints nothing

Any help would be appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source