September 2019
Beginner
512 pages
12h 52m
English
The RadialChartPainter class, like the RadialChart widget, differs in very specific parts from PieChartPainter, which was defined before. At first glance, its paint() method is almost the same as in the from pie chart:
// part of radial_chart.dart RadialChartPainter class @override void paint(Canvas canvas, Size size) { var center = Offset(size.width / 2, size.height / 2); var radius = size.width * 0.75 / 2; Rect chartRect = Rect.fromCircle( center: center, radius: radius, ); int total = values.reduce((a, b) => a + b); _paintTotal(canvas, total, chartRect); _paintCircle(canvas, total, chartRect); }
As you can see, the only difference is the additional call to _paintTotal(canvas, total, chartRect);.
Before we check ...
Read now
Unlock full access