Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Year Picker Error with Range when page is full (multiple of 12 + 1) #118

Open
cnschnei-btc opened this issue Jul 24, 2024 · 0 comments
Open

Comments

@cnschnei-btc
Copy link

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) {
     ...
  },
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant