Blame view

lib/common/widgets/timer_ticker.dart 212 Bytes
17a80689   liangchengyou   feat:倒计时功能开发
1
2
3
4
5
6
7
8
  ///定时器数据源
  class TimerTicker {
    const TimerTicker();
    Stream<int> tick({required int ticks}) {
      return Stream.periodic(const Duration(seconds: 1), (x) => ticks - x - 1)
          .take(ticks);
    }
  }