layoutText method

void layoutText(
  1. Offset offset,
  2. RadarBean bean,
  3. Canvas canvas
)

Implementation

void layoutText(Offset offset,RadarBean bean,Canvas canvas){
  final scoreTextPainter = TextPainter(
    textAlign: TextAlign.center,
    text: TextSpan(
      text: "${bean.name}\n${bean.score}",
      style: bean.textStyle,
    ),
    textDirection: TextDirection.ltr,
  );
  scoreTextPainter.layout();
  final scoreOffset = Offset(
    offset.dx - scoreTextPainter.width / 2,
    offset.dy - scoreTextPainter.height / 2,
  );
  scoreTextPainter.paint(canvas, scoreOffset);
}