Describe the bug
For example, now is 2023/7/5, and you set endDate 2023/7/5 to DataPicker, will not show 2023 in year scroll items.
To Reproduce
Steps to reproduce the behavior:
- Add a DataPicker Widget.
- Set endDate to 2023/7/5.
- click the DataPicker and show, the first item is 1923, the last item is 2022.
Expected behavior
2023 show be current selected, because it should select the date (default now) 2023/7/5
Screenshots

Additional context
current version is: ^4.4.0
lock version is: 4.5.1
but now version also has this bug.
It is the tips about how to solve this bug.
class _DatePickerState ::property currentYear
int get currentYear {
return List.generate(endYear - startYear, (index) {
return startYear + index;
}).firstWhere((v) => v == date.year, orElse: () => 0);
}
it should be, take 2023 ~ 2024 for example, it has 2 items.
int get currentYear {
return List.generate(endYear - startYear + 1, (index) {
return startYear + index;
}).firstWhere((v) => v == date.year, orElse: () => 0);
}
Describe the bug
For example, now is 2023/7/5, and you set endDate 2023/7/5 to DataPicker, will not show 2023 in year scroll items.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
2023 show be current selected, because it should select the date (default now) 2023/7/5
Screenshots

Additional context
current version is: ^4.4.0
lock version is: 4.5.1
but now version also has this bug.
It is the tips about how to solve this bug.
class _DatePickerState ::property currentYear
it should be, take 2023 ~ 2024 for example, it has 2 items.