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

Out of Range Error on Swap Animation #459

Closed
eli-front opened this issue Sep 27, 2020 · 13 comments
Closed

Out of Range Error on Swap Animation #459

eli-front opened this issue Sep 27, 2020 · 13 comments

Comments

@eli-front
Copy link

eli-front commented Sep 27, 2020

Describe the bug
When I use a swap animation an out of range error outputs, but this doesn't crash the app. It does make part of the view disappear for a short period of time. I think it may be because I am switching between sets of data with different amounts of data. I'm currently setting the swap animation to 0 as a workaround, which fixes the error, but I would like to use an animation. You can take a look at the code in the file, or the code I commented below this issue.

The following RangeError was thrown during paint():
RangeError (index): Invalid value: Not in inclusive range 0..4: 5

The relevant error-causing widget was:
LineChart file:///Users/elifront/Documents/bomber_barbell/lib/dataDetail.dart:300:20
When the exception was thrown, this was the stack:
#0 List.[] (dart:core-patch/growable_array.dart:177:60)
#1 _GraphState.mainData. (package:bomber_barbell/dataDetail.dart:382:29)
#2 LineChartPainter._drawTitles (package:fl_chart/src/chart/line_chart/line_chart_painter.dart:944:53)
#3 LineChartPainter.paint (package:fl_chart/src/chart/line_chart/line_chart_painter.dart:117:5)
#4 RenderCustomPaint._paintWithPainter (package:flutter/src/rendering/custom_paint.dart:531:13)
...
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#ad344
... parentData: (can use size)
... constraints: BoxConstraints(w=326.0, h=162.8)
... size: Size(326.0, 162.8)
RenderObject: RenderCustomPaint#ad344
parentData: (can use size)
constraints: BoxConstraints(w=326.0, h=162.8)
size: Size(326.0, 162.8)
════════════════════════════════════════════════════════════════════════════════════════════════════

To Reproduce
dataDetail.dart.zip
gist link
This code is also in the first comment below if you would prefer to look at it that way, but the formatting didn't work well, so you may prefer to just use the file.

Versions

  • Flutter 2.10.0-110.3.beta (also occurs on stable)
  • fl_chart: ^0.11.0
@eli-front eli-front reopened this Sep 27, 2020
@imaNNeo
Copy link
Owner

imaNNeo commented Oct 20, 2020

Here we have a large scroll page with a lot of un-readable code.
Please remove it and paste it in a gist. Then you can only paste the link here.

@eli-front
Copy link
Author

eli-front commented Oct 22, 2020

@imaNNeoFighT
I added a gist link under the zip file in the "how to reproduce" section. Both should work. It is also here.

@imaNNeo
Copy link
Owner

imaNNeo commented Dec 10, 2020

I cannot see your gist.
image

Because Github banned Iranians due to US sanctions.
F** them all.

@eli-front
Copy link
Author

@imaNNeoFighT you can try to use a VPN to get around Github’s ban or you can click on the zip file in the how to reproduce.

@imaNNeo
Copy link
Owner

imaNNeo commented Dec 15, 2020

No. My account is restricted, not my ip.

@eli-front
Copy link
Author

@imaNNeoFighT Then make sure you're signed out of your account. You don't need to be signed in to view a gist. If that doesn't work try to also use a VPN.

@JtheSaw
Copy link

JtheSaw commented Apr 22, 2021

Hey, I don't know if your problem still exists but I ran into a similar exception. You can check out my PR #643 which solved my problem.

@eli-front
Copy link
Author

Hey, I don't know if your problem still exists but I ran into a similar exception. You can check out my PR #643 which solved my problem.

Looks like that might fix it. I'll give it a test.

@imaNNeo
Copy link
Owner

imaNNeo commented Apr 30, 2021

@JtheSaw Please provide your reproducible code here, and mention this issue in your PR's description.

@PawlikMichal25
Copy link

I can confirm it's still happening on fl_chart: 0.36.1, Flutter: 2.2.1

@JtheSaw
Copy link

JtheSaw commented Jun 2, 2021

@BaranMichal25 Do you have some reproducible code that you could share in the PR #643 ?
I could not find time for that yet...

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 11, 2022

Can you please check it with the latest version of flutter and fl_chart?

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 14, 2022

I will close it.
Please share your reproducible code and let me re-open it if it still happens.

@imaNNeo imaNNeo closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants