DatePickerModel constructor
DatePickerModel({
- DateTime? currentTime,
- DateTime? maxTime,
- DateTime? minTime,
- LocaleType? locale,
Implementation
DatePickerModel(
{DateTime? currentTime,
DateTime? maxTime,
DateTime? minTime,
LocaleType? locale})
: super(locale: locale) {
this.maxTime = maxTime ?? DateTime(2049, 12, 31);
this.minTime = minTime ?? DateTime(1970, 1, 1);
currentTime = currentTime ?? DateTime.now();
if (currentTime.compareTo(this.maxTime) > 0) {
currentTime = this.maxTime;
} else if (currentTime.compareTo(this.minTime) < 0) {
currentTime = this.minTime;
}
this.currentTime = currentTime;
_fillLeftLists();
_fillMiddleLists();
_fillRightLists();
int minMonth = _minMonthOfCurrentYear();
int minDay = _minDayOfCurrentMonth();
_currentIndex[0] = this.currentTime.year - this.minTime.year;
_currentIndex[1] = this.currentTime.month - minMonth;
_currentIndex[2] = this.currentTime.day - minDay;
}