Clear selection RangePicker
When I disable some days and the user clicks on a day where both the previous and the next are disabled, he gets stuck, as he cannot select any range or deselect the day, a possible solution for this would be a way to clear the selection (selectedPeriod can be null for example)

@ReniDelonzek while I am thinking about best desition for such kind of situation you can use RangePicker.onSelectionError callback. It provides information about error that occurred during user's selection. So if callback is called you can manually set RangePicker.selectedPeriod to null there and call setState after change.
If u set RangePicker.selectedPeriod = null, the app crashes, other solution for this? i have the same problem :S
@jccd1996 RangePicker has onSelectionError property. It provides information about period user would like to select but can't because of disabled dates. You can use this information to change selection something like this:
void _onSelectionError(UnselectablePeriodException exception) {
DatePeriod errorPeriod = exception.period;
// If user supposed to set another start of the period.
bool selectStart = _selectedPeriod.start != errorPeriod.start;
DateTime newSelection = selectStart
? errorPeriod.start
: errorPeriod.end;
DatePeriod newPeriod = DatePeriod(newSelection, newSelection);
setState(() {
_selectedPeriod = newPeriod;
});
}
Pass this function to RangePicker constructor (look at onSelectionError).
RangePicker(
selectedPeriod: _selectedPeriod,
onChanged: _onSelectedDateChanged,
firstDate: _firstDate,
lastDate: _lastDate,
datePickerStyles: styles,
eventDecorationBuilder: _eventDecorationBuilder,
selectableDayPredicate: _isSelectableCustom,
onSelectionError: _onSelectionError
)
@MariaMelnik Thank you so much!, this solution its exactly that was i looking for!