Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ae2c63c

Browse files
committed
Fixed ScatterChart default touchHandling crash
1 parent f733df5 commit ae2c63c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* **IMPROVEMENT** Again we support `longPress` touch events. check [FlTouchEvent](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/base_chart.md#fltouchevent) to see all kind of supported touch/pointer events (which can be `FlLongPressStart`, `FlLongPressMoveUpdate`, `FlLongPressEnd`, ...). Also you can check out [touch handling doc](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/handle_touches.md), #649.
66
* **IMPROVEMENT** Added `mouseCursorResolver` callback in touchData classes such as [LineTouchData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/line_chart.md#linetouchdata-read-about-touch-handling) and [BarTouchData](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/bar_chart.md#bartouchdata-read-about-touch-handling). You can change the [MouseCursor](https://api.flutter.dev/flutter/services/MouseCursor-class.html) based on the provided [FlTouchEvent](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/base_chart.md#fltouchevent) and touchResponse using this callback. (We have used this feature in [PieChartSample2](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/scatter_chart.md#sample-2-source-code))
77
* **BUGFIX** Fixed calling `ScatterChartData.copyWith()` function problem on calculating `minX`, `maxX`, `minY` and `maxY` when they are not provided.
8+
* **BUGFIX** Fixed `ScatterChart` default touchHandling crash
89
* **NEWS** Your donation **motivates** me to work more on the `fl_chart` and resolve more issues. Now you can [buy me a coffee](https://www.buymeacoffee.com/fl_chart)!
910

1011
## 0.36.4

lib/src/chart/scatter_chart/scatter_chart.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ class _ScatterChartState extends AnimatedWidgetBaseState<ScatterChart> {
7777
if (!desiredTouch || touchResponse == null || touchResponse.touchedSpot == null) {
7878
setState(() {
7979
touchedSpots = [];
80-
return;
8180
});
81+
return;
8282
}
8383
setState(() {
84-
touchedSpots = [touchResponse!.touchedSpot!.spotIndex];
84+
touchedSpots = [touchResponse.touchedSpot!.spotIndex];
8585
});
8686
}
8787

0 commit comments

Comments
 (0)