fl_chart
fl_chart copied to clipboard
[Bug] Error when increasing PieChartData sections if badgeWidget is used
An error occurs when the sections of PieChartData are updated, especially when the number of sections increases. This issue only appears when a badgeWidget is provided.
The following RangeError was thrown during paint():
RangeError (length): Invalid value: Not in inclusive range 0..1: 2
The relevant error-causing widget was:
PieChartLeaf PieChartLeaf:file:///Users/ganwumeng/.pub-cache/hosted/pub.dev/fl_chart-0.70.2/lib/src/chart/pie_chart/pie_chart.dart:57:12
When the exception was thrown, this was the stack:
#0 List.[] (dart:core-patch/growable_array.dart)
#1 RenderPieChart.badgeWidgetPaint (package:fl_chart/src/chart/pie_chart/pie_chart_renderer.dart:154:24)
#2 RenderPieChart.paint (package:fl_chart/src/chart/pie_chart/pie_chart_renderer.dart:146:5)
- Flutter Version: 3.32.8
- FlChart Version: 1.0.0