The argument type 'Image' can't be assigned to the parameter type 'Image?'.
itss-sid opened this issue · 12 comments
I am trying to export a QR code with an embedded image but I am not able to do that because it doesn't accept any type of image. I have tried literally every type of image possible still it just won't accept. What does it want?
My Code:
final painter = QrPainter.withQr(
qr: qrCode!,
color: const Color(0xFF000000),
gapless: true,
embeddedImageStyle: null,
embeddedImage: Image(image: null,)
);
Use AssetImage or NetworkImage.
Use AssetImage or NetworkImage.
Already tried, they give the same error.
Show your code when using my above suggestion.
I know I have to enter image URL in NetworkImage, I just did for testing and to show you.
Oh you're using QrPainter, not QrImageView. Is that intentional?
QrPainter expects a type of Image from dart:ui, not flutter/widgets.
Oh you're using QrPainter, not QrImageView. Is that intentional?
Yes, I need an Embedded image when exporting the QR Code.
QrPainter expects a type of Image from dart:ui, not flutter/widgets.
So, what should I do to give it an Embedded image when exporting the QR ?