TimeInput constructor

const TimeInput({
  1. Key? key,
  2. ComponentController<TimeOfDay?>? controller,
  3. TimeOfDay? initialValue,
  4. ValueChanged<TimeOfDay?>? onChanged,
  5. bool enabled = true,
  6. Widget? placeholder,
  7. bool showSeconds = false,
  8. InputPart? separator,
  9. Map<TimePart, Widget>? placeholders,
})

Creates a TimeInput.

Either controller or onChanged should be provided for interactivity. The widget supports both controller-based and callback-based state management patterns with structured time component entry.

Parameters:

  • controller (ComponentController<TimeOfDay?>?, optional): external state controller
  • initialValue (TimeOfDay?, optional): starting time when no controller
  • onChanged (ValueChanged<TimeOfDay?>?, optional): time change callback
  • enabled (bool, default: true): whether input is interactive
  • placeholder (Widget?, optional): widget shown when no time selected
  • showSeconds (bool, default: false): whether to include seconds input
  • separator (InputPart?, optional): separator between time components
  • placeholders (Map<TimePart, Widget>?, optional): placeholders for time parts

Example:

TimeInput(
  controller: controller,
  showSeconds: true,
  separator: InputPart.text(':'),
  placeholders: {
    TimePart.hour: Text('HH'),
    TimePart.minute: Text('MM'),
    TimePart.second: Text('SS'),
  },
)

Implementation

const TimeInput({
  super.key,
  this.controller,
  this.initialValue,
  this.onChanged,
  this.enabled = true,
  this.placeholder,
  this.showSeconds = false,
  this.separator,
  this.placeholders,
});