i want to create a signature area like Here with dart in a mobile app!
I tried to use the CustomPaint class ... But it doesn't work.
Can anyone help me?
i want to create a signature area like Here with dart in a mobile app!
I tried to use the CustomPaint class ... But it doesn't work.
Can anyone help me?
You can create a signature area using
GestureDetector
to record touches andCustomPaint
to draw on the screen. Here are a few tips:RenderBox.globalToLocal
to convert theDragUpdateDetails
provided byGestureDetector.onPanUpdate
into relative coordinatesGestureDetector.onPanEnd
gesture handler to record the breaks between strokes.List
won't automatically trigger a repaint because theCustomPainter
constructor arguments are the same. You can trigger a repaint by creating a newList
each time a new point is provided.Canvas.drawLine
to draw a rounded line between each of the recorded points of the signature.