imaNNeo / imaNNeo/fl_chart

error in using latest 1.1.0: vector_math error

Open
#1,985 14 comments 16 reactions 0 assignees View on GitHub
enhancement Fundamental
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

**Describe the bug**
Bumped to v1.1.0 recently, got the following error when trying to run the project
```
- 'Matrix4' is from 'package:vector_math/vector_math_64.dart' ('../../../../../../.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/vector_math_64.dart').
Try correcting the name to the name of an existing method, or defining a method named 'translateByDouble'.
..translateByDouble(
^^^^^^^^^^^^^^^^^
../../../../../../.pub-cache/hosted/pub.dev/fl_chart-1.1.0/lib/src/chart/base/custom_interactive_viewer.dart:534:9: Error: The method 'scaleByDouble' isn't defined for the class 'Matrix4'.
custom_interactive_viewer.dart:534
- 'Matrix4' is from 'package:vector_math/vector_math_64.dart' ('../../../../../../.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/vector_math_64.dart').
Try correcting the name to the name of an existing method, or defining a method named 'scaleByDouble'.
..scaleByDouble(clampedScale, clampedScale, clampedScale, 1);
^^^^^^^^^^^^^
../../../../../../.pub-cache/hosted/pub.dev/fl_chart-1.1.0/lib/src/chart/base/custom_interactive_viewer.dart:1114:7: Error: The method 'translateByDouble' isn't defined for the class 'Matrix4'.
custom_interactive_viewer.dart:1114
- 'Matrix4' is from 'package:vector_math/vector_math_64.dart' ('../../../../../../.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/vector_math_64.dart').
Try correcting the name to the name of an existing method, or defining a method named 'translateByDouble'.
..translateByDouble(rect.size.width / 2, rect.size.height / 2, 0, 1)
^^^^^^^^^^^^^^^^^
../../../../../../.pub-cache/hosted/pub.dev/fl_chart-1.1.0/lib/src/chart/base/custom_interactive_viewer.dart:1116:7: Error: The method 'translateByDouble' isn't defined for the class 'Matrix4'.
custom_interactive_viewer.dart:1116
- 'Matrix4' is from 'package:vector_math/vector_math_64.dart' ('../../../../../../.pub-cache/hosted/pub.dev/vector_math-2.1.4/lib/vector_math_64.dart').
Try correcting the name to the name of an existing method, or defining a method named 'translateByDouble'.
..translateByDouble(-rect.size.width / 2, -rect.size.height / 2, 0, 1);
^^^^^^^^^^^^^^^^^
```

**To Reproduce**
Just bump the fl_chart to 1.1.0

**Screenshots**
If applicable, add screenshots, or videoshots to help explain your problem.

**Versions**
- which version of the Flutter are you using?
- flutter: 3.32.6
- dart: 3.8.1
- which version of the FlChart are you using?
- 1.1.0

Contributor guide

Open the contributing guide

Research direction

Start with src/chart/base/custom_interactive_viewer.dart, especially the reported locations around lines 534 and 1114, and compare them with the Matrix4 API provided by vector_math 2.1.4. Reproduce the failure using Flutter 3.32.6 and Dart 3.8.1 after upgrading to fl_chart 1.1.0. Done means the project builds without the reported translateByDouble and scaleByDouble errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.