paintBar method

void paintBar(
  1. Size size,
  2. Canvas canvas,
  3. TextSpan? span
)

Character arrangement according to height and width.

Implementation

void paintBar(Size size, Canvas canvas, TextSpan? span) {
  double degToRad(double deg) => deg * (pi / 180.0);
  final textSpan = span;
  final textPainter = TextPainter(
    text: textSpan,
    textDirection: TextDirection.ltr,
  );
  textPainter.layout(
    minWidth: 0,
    maxWidth: size.width,
  );
  canvas.rotate(degToRad(radData == RadData.horizontal ? 360 : 90));
  textPainter.paint(canvas, offsetValue);
}