toPicture method
Returns a ui.Picture object containing the QR code data.
Implementation
ui.Picture toPicture(double size) {
final recorder = ui.PictureRecorder();
final canvas = Canvas(recorder);
paint(canvas, Size(size, size));
return recorder.endRecording();
}