dateIntervalType property
The type of date interval. It is mandatory for date SfSlider.
It can be years to seconds.
For date value, the slider doesn’t have auto interval support. So, you may need to set interval, dateIntervalType, and dateFormat for date value, if labels, ticks, and dividers are needed.
Defaults to null
.
This snippet shows how to set date interval type in SfSlider.
DateTime _value = DateTime(2002, 01, 01);
SfSlider(
min: DateTime(2000, 01, 01, 00),
max: DateTime(2005, 12, 31, 24),
value: _value,
interval: 1,
dateFormat: DateFormat.y(),
dateIntervalType: DateIntervalType.years,
onChanged: (dynamic newValue) {
setState(() {
_value = newValue;
});
},
)
Implementation
final DateIntervalType? dateIntervalType;