There is an error with the Year Picker Range. If the range of dates between the firstDate and the lastDate matches the pattern: 12 * x + 1. So for example 13, 25, ....
Example:
We have 25 years, from 2000 to 2024, then the 2024th year wont get a new page, in this case it would be the 3rd page.
If then the selectedDate value is the 2024th year, there will be a range error 0...1, -2.
════════ Exception caught by widgets library ═══════════════════════════════════
RangeError (index): Invalid value: Not in inclusive range 0..1: -2
The relevant error-causing widget was:
════════════════════════════════════════════════════════════════════════════════
I wont get any more details but i figured it out by tweaking the values.
Example Code:
YearPicker.single(
selectedDate: DateTime(2024),
firstDate: DateTime(2000),
lastDate: DateTime(2024),
onChanged: (value) {
...
},
),
There is an error with the Year Picker Range. If the range of dates between the firstDate and the lastDate matches the pattern: 12 * x + 1. So for example 13, 25, ....
Example:
We have 25 years, from 2000 to 2024, then the 2024th year wont get a new page, in this case it would be the 3rd page.
If then the selectedDate value is the 2024th year, there will be a range error 0...1, -2.
════════ Exception caught by widgets library ═══════════════════════════════════
RangeError (index): Invalid value: Not in inclusive range 0..1: -2
The relevant error-causing widget was:
════════════════════════════════════════════════════════════════════════════════
I wont get any more details but i figured it out by tweaking the values.
Example Code: