prev method

  1. @override
DatepickerDateRange? prev()
override

Tries to revert to the previous item, and returns it if possible.

Implementation

@override
DatepickerDateRange? prev() {
  final prev = value?.range?.prev;
  if (prev == null) return null;
  final amt =
      daysSpanned(prev.start!, value!.range!.start!, inclusive: false);
  if (_customComparisonRange != null) {
    _customComparisonRange = DatepickerDateRange.custom(
        _customComparisonRange!.start!.add(days: -amt),
        _customComparisonRange!.end!.add(days: -amt));
  }
  _changeValue(_withComparison(prev), Action.button);
  return prev;
}