DurationInput constructor
const
DurationInput({})
Creates a DurationInput.
Either controller
or onChanged
should be provided for interactivity.
The widget supports both controller-based and callback-based state management
patterns with structured duration component entry.
Parameters:
controller
(ComponentController<Duration?>?, optional): external state controllerinitialValue
(Duration?, optional): starting duration when no controlleronChanged
(ValueChanged<Duration?>?, optional): duration change callbackenabled
(bool, default: true): whether input is interactiveplaceholder
(Widget?, optional): widget shown when no duration selectedshowSeconds
(bool, default: false): whether to include seconds inputseparator
(InputPart?, optional): separator between duration componentsplaceholders
(Map<TimePart, Widget>?, optional): placeholders for time parts
Example:
DurationInput(
controller: controller,
showSeconds: true,
separator: InputPart.text(':'),
placeholders: {
TimePart.hour: Text('HH'),
TimePart.minute: Text('MM'),
TimePart.second: Text('SS'),
},
)
Implementation
const DurationInput({
super.key,
this.controller,
this.initialValue,
this.onChanged,
this.enabled = true,
this.placeholder,
this.showSeconds = false,
this.separator,
this.placeholders,
});