TimeBuilder.eachSecond constructor

TimeBuilder.eachSecond({
  1. Key? key,
  2. int? seconds,
  3. required TimeBuilderBuilder builder,
})

Creates a TimeBuilder that rebuilds in each second.

For example, this will show a clock that rebuilds each second:

TimerWidget.eachSecond(
  builder: ({ ... , required DateTime currentTickTime, ... })
     => ClockRenderer(dateTime: currentTickTime);
);

If you pass seconds it will stop when reaching that number of ticks.

Implementation

TimeBuilder.eachSecond({Key? key, int? seconds, required this.builder})
    : ifShouldTickAndRebuild = _eachSecond,
      isFinished = _ifFinished(seconds),
      super(key: key);