CalendarDateRangePicker constructor
CalendarDateRangePicker({
- Key? key,
- NepaliDateTime? initialStartDate,
- NepaliDateTime? initialEndDate,
- required NepaliDateTime firstDate,
- required NepaliDateTime lastDate,
- NepaliDateTime? currentDate,
- required ValueChanged<
NepaliDateTime> ? onStartDateChanged, - required ValueChanged<
NepaliDateTime> ? onEndDateChanged,
Creates a scrollable calendar grid for picking date ranges.
Implementation
CalendarDateRangePicker({
Key? key,
NepaliDateTime? initialStartDate,
NepaliDateTime? initialEndDate,
required NepaliDateTime firstDate,
required NepaliDateTime lastDate,
NepaliDateTime? currentDate,
required this.onStartDateChanged,
required this.onEndDateChanged,
}) : initialStartDate =
initialStartDate != null ? utils.dateOnly(initialStartDate) : null,
initialEndDate =
initialEndDate != null ? utils.dateOnly(initialEndDate) : null,
firstDate = utils.dateOnly(firstDate),
lastDate = utils.dateOnly(lastDate),
currentDate = utils.dateOnly(currentDate ?? NepaliDateTime.now()),
super(key: key) {
assert(
this.initialStartDate == null ||
this.initialEndDate == null ||
!this.initialStartDate!.isAfter(initialEndDate!),
'initialStartDate must be on or before initialEndDate.');
assert(!this.lastDate.isBefore(this.firstDate),
'firstDate must be on or before lastDate.');
}