TimerBuilder constructor

TimerBuilder({
  1. required TimerGenerator generator,
  2. required WidgetBuilder builder,
})

Use this constructor only if you need to provide a custom TimerGenerator. For general cases, prefer to use TimerBuilder.periodic and TimerBuilder..scheduled This constructor accepts a custom generator function that returns the next time event to rebuild on.

Implementation

TimerBuilder({
  /// Returns the next time event. If the returned time is in the past, it will be ignored and
  /// the generator will be called again to retrieve the next time event.
  /// If the generator returns [null], it indicates the end of time event sequence.
  required this.generator,

  /// Builds the widget. Called for every time event or when the widget needs to be built/rebuilt.
  required this.builder,
});