drawWhiteText method Null safety

void drawWhiteText(
  1. Canvas canvas,
  2. TextStyle style,
  3. String text,
  4. double w
)

Implementation

void drawWhiteText(Canvas canvas, TextStyle style, String text, double w) {
  // draw white text
  TextSpan span = TextSpan(style: style, text: text);
  TextPainter tp = TextPainter(
      text: span,
      textAlign: TextAlign.center,
      textDirection: TextDirection.ltr);
  tp.layout(minWidth: w);
  tp.paint(canvas, keyTextOffset);
}