Skip to content

Commit b16be1f

Browse files
authored
Merge pull request #10 from kcoms555/master
Fix an issue while calling onTap: close #8
2 parents 5356da6 + be31886 commit b16be1f

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)