throttle method
Implementation
Stream<T> throttle(Duration duration) {
var lastEmit = DateTime.fromMillisecondsSinceEpoch(0);
return where((_) {
final now = DateTime.now();
if (now.difference(lastEmit) >= duration) {
lastEmit = now;
return true;
}
return false;
});
}