paint method

  1. @override
void paint(
  1. Canvas canvas,
  2. Size size
)
override

This will paint on the screen

Implementation

@override
void paint(Canvas canvas, Size size) {
  TextSpan span = new TextSpan(
      style: new TextStyle(
          color: Colors.lightGreenAccent,
          fontSize: 24.0,
          fontFamily: 'Roboto'),
      text: "$fps");
  TextPainter tp = new TextPainter(
      text: span,
      textAlign: TextAlign.left,
      textDirection: TextDirection.ltr);
  tp.layout();
  tp.paint(canvas, new Offset(0, 0));
}