take-->What role does it play (flutter and Dart)
class Ticker {
Stream<int> tick({int ticks}) => Stream.periodic(Duration(seconds: 1), (x) {
return ticks - x - 1;
}).take(ticks);
}
take-->What role does it play (flutter and Dart)
class Ticker {
Stream<int> tick({int ticks}) => Stream.periodic(Duration(seconds: 1), (x) {
return ticks - x - 1;
}).take(ticks);
}
Copyright © 2021 Jogjafile Inc.
So simply, it just takes items as count of you pass(ticks parameter) from a stream.