toggleDaySelection property
Allows to deselect a date when the DateRangePickerSelectionMode set as DateRangePickerSelectionMode.single.
When this toggleDaySelection property set as true
tapping on a single
date for the second time will clear the selection, which means setting
this property as true
allows to deselect a date when the
DateRangePickerSelectionMode set as single.
Defaults to false
.
See also:
- selectionMode, which allows to set different selection modes for date range picker.
- selectionShape, which allows to customize the shape of the selection view in date range picker.
- onSelectionChanged, callback which notifies whenever the selection changed on date range picker.
- selectionRadius, which is the radius for the selection view in the date range picker when the selection shape set as DateRangePickerSelectionShape.circle.
- initialSelectedDate, which allows to select date programmatically initially on date range picker.
- DateRangePickerController.selectedDate,which allows to select date programmatically dynamically on date range picker.
- Knowledge base: How to deselect the selected date
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.single,
toggleDaySelection: true,
),
),
);
}
Implementation
final bool toggleDaySelection;