multi static method

MonthPicker<List<DateTime>> multi({
  1. Key? key,
  2. required List<DateTime> selectedDates,
  3. required ValueChanged<List<DateTime>> onChanged,
  4. required DateTime firstDate,
  5. required DateTime lastDate,
  6. DatePickerLayoutSettings datePickerLayoutSettings = const DatePickerLayoutSettings(),
  7. DatePickerStyles? datePickerStyles,
  8. DatePickerKeys? datePickerKeys,
  9. SelectableDayPredicate? selectableDayPredicate,
  10. ValueChanged<DateTime>? onMonthChanged,
})

Creates a month picker where many single months can be selected.

See also:

Implementation

static MonthPicker<List<DateTime>> multi(
    {Key? key,
    required List<DateTime> selectedDates,
    required ValueChanged<List<DateTime>> onChanged,
    required DateTime firstDate,
    required DateTime lastDate,
    DatePickerLayoutSettings datePickerLayoutSettings =
        const DatePickerLayoutSettings(),
    DatePickerStyles? datePickerStyles,
    DatePickerKeys? datePickerKeys,
    SelectableDayPredicate? selectableDayPredicate,
    ValueChanged<DateTime>? onMonthChanged}) {
  assert(!firstDate.isAfter(lastDate));
  assert(!lastDate.isBefore(firstDate));

  final selection = MonthPickerMultiSelection(selectedDates);
  final selectionLogic = MonthMultiSelectable(
      selectedDates, firstDate, lastDate,
      selectableDayPredicate: selectableDayPredicate);

  return MonthPicker<List<DateTime>>._(
    onChanged: onChanged,
    firstDate: firstDate,
    lastDate: lastDate,
    selectionLogic: selectionLogic,
    selection: selection,
    datePickerKeys: datePickerKeys,
    datePickerStyles: datePickerStyles ?? DatePickerStyles(),
    datePickerLayoutSettings: datePickerLayoutSettings,
  );
}