timed_builder library Null safety


A widget that rebuilds on specific and / or periodic Timer events.


alignDateTime(DateTime dt, Duration alignment, [bool roundUp = false]) DateTime
Rounds down or up a DateTime object using a Duration object. If roundUp is true, the result is rounded up, otherwise it's rounded down. If the duration is a multiple of days, the result will be aligned at the day mark in the timezone of the source datetime.
createTimedStream(TimedGenerator generator, Future stopSignal) Stream<DateTime>
Creates a stream tha produces DateTime objects at the times specified by the generator. Stops the stream when stopSignal is received.
fromIterable(Iterable<DateTime> iterable) TimedGenerator
getAlignmentUnit(Duration interval) Duration
Returns an alignment unit can be passed to alignDateTime in order to align the date/time units. For example, if the specified interval is 15 minutes, the alignment unit is 1 minute.
periodicTimer(Duration interval, {Duration alignment = Duration.zero}) TimedGenerator
scheduledTimer(Iterable<DateTime> schedule) TimedGenerator


TimedGenerator = DateTime? Function(DateTime now)
Used by TimerBuilder to determine the next DateTime to trigger a rebuild on