TimeInput constructor
const
TimeInput({})
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 controllerinitialValue
(TimeOfDay?, optional): starting time when no controlleronChanged
(ValueChanged<TimeOfDay?>?, optional): time change callbackenabled
(bool, default: true): whether input is interactiveplaceholder
(Widget?, optional): widget shown when no time selectedshowSeconds
(bool, default: false): whether to include seconds inputseparator
(InputPart?, optional): separator between time componentsplaceholders
(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,
});