0
I have the following dialog and would like to generate a "voucher" so that the person could share it, as if it were proof of payments that the bank applications generate.
I managed to take a "print" using Renderrepaintbundary, with the code below, but it gets a horrible resolution and with the texts very disproportionate.
RenderRepaintBoundary boundary = globalKey.currentContext.findRenderObject();
var image = await boundary.toImage(pixelRatio: 5.0);
ByteData byteData = await image.toByteData(format: ImageByteFormat.png);
Uint8List pngBytes = byteData.buffer.asUint8List();
final tempDir = await getTemporaryDirectory();
final file = await new File('${tempDir.path}/image.png').create();
await file.writeAsBytes(pngBytes);
final ByteData bytes = await rootBundle.load(file.path);
await Share.file('Invite', 'qrcode.png', bytes.buffer.asUint8List(), 'image/png', text: 'Convite para entrada no meu condomínio');