multi static method
MonthPicker<List<DateTime> >
multi({
- Key? key,
- required List<
DateTime> selectedDates, - required ValueChanged<
List< onChanged,DateTime> > - required DateTime firstDate,
- required DateTime lastDate,
- DatePickerLayoutSettings datePickerLayoutSettings = const DatePickerLayoutSettings(),
- DatePickerStyles? datePickerStyles,
- DatePickerKeys? datePickerKeys,
- SelectableDayPredicate? selectableDayPredicate,
- ValueChanged<
DateTime> ? onMonthChanged,
Creates a month picker where many single months can be selected.
See also:
- MonthPicker.single - month picker where only one single month can be selected.
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,
);
}