stepDuration property
Option to select discrete date values.
For example, if min is DateTime(2015, 01, 01) and max is DateTime(2020, 01, 01) and stepDuration is SliderStepDuration(years: 1, months: 6), the range selector will move the thumbs at DateTime(2015, 01, 01), DateTime(2016, 07, 01), DateTime(2018, 01, 01),and DateTime(2019, 07, 01).
Defaults to null.
This snippet shows how to set stepDuration in SfRangeSelector.
SfRangeSelector(
min: DateTime(2015, 01, 01),
max: DateTime(2020, 01, 01),
initialValues: SfRangeValues(
DateTime(2017, 04,01), DateTime(2018, 08, 01)),
enableTooltip: true,
stepDuration: SliderStepDuration(years: 1, months: 6),
interval: 2,
showLabels: true,
showTicks: true,
minorTicksPerInterval: 1,
dateIntervalType: DateIntervalType.years,
dateFormat: DateFormat.yMd(),
child: Container(
color: Colors.pink[100],
height: 150,
),
)
See also:
- interval, for setting the interval.
- dateIntervalType, for changing the interval type.
- dateFormat for formatting the date labels.
Implementation
final SliderStepDuration? stepDuration;