Open
Description
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(
child: CustomPaint(
foregroundPainter: SelectionPainter(notifier: notifierForeground),
child: RepaintBoundary(
child: CanvasTouchDetector(
//key: UniqueKey(),
gesturesToOverride: const [
GestureType.onTapDown,
],
builder: (BuildContext context) {
return CustomPaint(
isComplex: true,
willChange: false,
painter: ChartPainter<D, Rx, Ry>(
onItemSelected: (List<Rect> selectionRects, item, index, xAxisIndex, layer, tapEvent) {
notifierForeground.value = selectionRects;
_showTooltip(selectionRects);
},
),
);
},
),
),
),
),
],
);
}
After state.build
called multi times, onTapDown event will also fire multi times with one click. It seems pre touch rects not cleared ?
Workaround: add UniqueKey
to CanvasTouchDetector
Metadata
Metadata
Assignees
Labels
No labels