TimerBuilder constructor
const
TimerBuilder({
- Key? key,
- required TimerGenerator generator,
- 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
const TimerBuilder({
super.key,
/// 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,
});