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

Another exception was thrown: NoSuchMethodError: The method '>' was called on null. #44

Closed
ZahidTekbas opened this issue Oct 18, 2021 · 2 comments

Comments

@ZahidTekbas
Copy link

ZahidTekbas commented Oct 18, 2021

I have a trouble with the package. Sometimes, it says "Another exception was thrown: NoSuchMethodError: The method '>' was called on null" and it does not print any chart. Is there a way to solve that or to detect which method causes error?

edit: it could be related to this error:
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following NoSuchMethodError was thrown during paint():
The method 'toDouble' was called on null.
Receiver: null
Tried calling: toDouble()

The relevant error-causing widget was:
CustomPaint
CustomPaint:file:///Users/mac13/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/k_chart-0.4.0/lib/k_chart_widget.dart:194:11

@mafanwei
Copy link
Collaborator

Thank you for your feedback.
mScrollX = (details.primaryDelta! / mScaleX + mScrollX) .clamp(0.0, ChartPainter.maxScrollX) .toDouble();
primaryDelta may be null. If the [GestureDragUpdateCallback] is for a two-dimensional drag (e.g., a pan), then this value is null.
I will fix this bug.

@mafanwei
Copy link
Collaborator

done. See 0.4.1.

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

2 participants