dispose method
void
dispose()
Disposes of canvas resources and finalizes picture recording.
Should be called when the canvas is no longer needed to properly clean up resources and finalize any ongoing picture recording.
Implementation
void dispose() {
_pictureRecorder?.endRecording();
}