I cannot figure out on how to convert a generated qr code by the use of QrImageView into a image file type that can be saved in the database
This is my code for generating a qr code:
Widget buildGenerateQrCode(){
String qrData = '$docu_title, $docu_type, $docu_sender, $docu_recipient, $_selectedFile';
return QrImageView(
data: qrData,
version: QrVersions.auto,
size: 200.0,
);
}
2
Answers
Use
QrPainter
class of theqr_flutter
package.You can do something with the image data, send it to database or save on disk.
Source: https://github.com/theyakka/qr.flutter/issues/115
Convert any UI widget to Image without package
Creating raw image from Widget or Canvas
and then save it local storage as file using
dart:io
and https://pub.dev/packages/path_provider