take method
Take only first n value changes
Implementation
void take(int count, void Function(T value) callback) {
var callCount = 0;
late VoidCallback listener;
listener = () {
if (callCount < count) {
callCount++;
callback(value);
if (callCount >= count) {
removeListener(listener);
}
}
};
addListener(listener);
}