Skip to content

Commit be31886

Browse files
committed
Fix an issue while calling onTap: close #8
1 parent 5356da6 commit be31886

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/interactive_chart.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,10 @@ class _InteractiveChartState extends State<InteractiveChart> {
212212
}),
213213
onTapCancel: () => setState(() => _tapPosition = null),
214214
onTapUp: (_) {
215-
setState(() => _tapPosition = null);
216-
// Fire callback event (if needed)
215+
// Fire callback event (if onTap() is available)
216+
// call _fireOnTapEvent() before assigning null on _tapPosition
217217
if (widget.onTap != null) _fireOnTapEvent();
218+
setState(() => _tapPosition = null);
218219
},
219220
// Pan and zoom
220221
onScaleStart: (details) => _onScaleStart(details.localFocalPoint),

0 commit comments

Comments
 (0)