September 2019
Beginner
512 pages
12h 52m
English
In our example, values and colors describe the drawing, so whenever either of them change, we need to repaint our widget. So, we need to reflect this in the shouldRepaint method, as follows:
// part of pie_chart.dart file PieChartPainter class@overridebool shouldRepaint(PieChartPainter oldDelegate) { return !ListEquality().equals(oldDelegate.values, values) || !ListEquality().equals(oldDelegate.colors, colors);}
Read now
Unlock full access