drawText method

void drawText(
  1. Canvas canvas,
  2. Size size,
  3. String text,
  4. Offset offset,
)

Implementation

void drawText(Canvas canvas, Size size, String text, Offset offset) {
  textPainter.text = TextSpan(style: textStyle, text: text);
  textPainter.layout();
  textPainter.paint(canvas, Offset((offset.dx - (textPainter.width * 0.5)), offset.dy - (textPainter.height) * 0.5));
}