Solution :
The path provider does not allow to download a QR code and it has limitations in Flutter Web so here’s the solution for your query
downloadQR(String data) async {
final qrValidationResult =
QrValidator.validate(
data: data,
version: QrVersions.auto,
errorCorrectionLevel: QrErrorCorrectLevel.L,
);
final qrCode = qrValidationResult.qrCode; final image = await QrPainter.withQr(
qr: qrCode!,
color: const Color(0xFF000000),
gapless: true,
embeddedImageStyle: null,
embeddedImage: null,
).toImageData(1000); var pngBytes = image!.buffer.asUint8List(); var download = document.createElement(‘a’)
as AnchorElement; download.href =
‘data:image/png;base64,${base64Encode(pngBytes)}’;
download.download = ‘qr_code.png’; download.click();
}