DateTimeLoopBuilder constructor

const DateTimeLoopBuilder({
  1. Key? key,
  2. TimeUnit? timeUnit,
  3. DateTimeLoopController? controller,
  4. DateTime getNow()?,
  5. bool triggerOnStateChange = true,
  6. required DateTimeLoopWidgetBuilder builder,
  7. Widget? child,
})

DateTimeLoopBuilder is a Widget that listens to the system's datetime and triggers a rebuild of its child widget based on the specified time unit. This allows you to create dynamic UI elements that update at regular intervals.

Implementation

const DateTimeLoopBuilder({
  super.key,
  this.timeUnit,
  this.controller,
  this.getNow,
  this.triggerOnStateChange = true,
  required this.builder,
  this.child,
}) : assert(controller != null || timeUnit != null,
          'Either controller or timeUnit must be provided.');