CustomPaint that requires a painter:

    
 
   
     Test in DartPad
   
   
     View on GitHub
   
 
 

    
 CustomPaint(
   painter: SignaturePainter(_points),
   size: Size.infinite,
 ),

CustomPainter that implements your algorithm to draw to the canvas.

    
 
   
     Test in DartPad
   
   
     View on GitHub
   
 
 

    
 class SignaturePainter extends CustomPainter {
   SignaturePainter(this.points);

   final List<Offset?> points;