enableSwipeSelection property
Enables the swipe selection for SfDateRangePicker, which allows to select the range of dates by swiping on the dates.
If it is false
selecting a two different dates will form the range of
dates by covering the dates between the selected dates.
Defaults to true
.
Note: It is only applicable when the DateRangePickerSelectionMode set as DateRangePickerSelectionMode.range or DateRangePickerSelectionMode.multiRange.
See also:
- DateRangePickerSelectionMode, which contains different selection modes for the date range picker.
- SfDateRangePicker.enableMultiView, which displays two date range picker side by side based on the SfDateRangePicker.navigationDirection value.
- Knowledge base: How to restrict swipe gesture for range selection
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
controller: _pickerController,
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.range,
monthViewSettings:
DateRangePickerMonthViewSettings(
enableSwipeSelection: false),
),
),
);
}
Implementation
final bool enableSwipeSelection;