diff --git a/charts_flutter/lib/src/chart_container.dart b/charts_flutter/lib/src/chart_container.dart index 94f74f07b..7f00ece31 100644 --- a/charts_flutter/lib/src/chart_container.dart +++ b/charts_flutter/lib/src/chart_container.dart @@ -300,6 +300,12 @@ class ChartContainerRenderObject extends RenderCustomPaint a11yNodes: _a11yNodes ?? [], textDirection: textDirection); } + + @override + void dispose() { + _chart!.destroy(); + super.dispose(); + } } class ChartContainerCustomPaint extends CustomPainter {