You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
insert the code outside of class final result = zx.encodeBarcode( 'Text to encode', format: Format.qrCode, width: 300, height: 300, margin: 10, eccLevel: 0, );
put this code in the _MyHomePageState build function final imglib.Image img; Uint8List encodedBytes = Uint8List.fromList([0]); if (result.isValid && result.data != null) { img = imglib.Image.fromBytes(300, 100, result.data!.toList()); encodedBytes = Uint8List.fromList(imglib.encodeJpg(img)); // use encodedBytes as you wish }
Thank you for your suggestion. As a temporary workaround, you could try using a smaller image size such as 120x120 for generating QR codes. This should help avoid any issues with large image sizes on iOS.
I am still working on finding a more permanent solution to this issue and will keep you updated as soon as I have any progress to report.
Hello @khoren93,
I also encountered a similar error, and this error still exists in version 1.0.2. As your suggestion, I tried to create a code128 with a size of 174x87 without any errors. However, as soon as I increased the size to 175x88 or larger, the error occurred.
I am running my code on an iOS 16.2 simulator and I am able to generate large Code128 barcodes (300x150) without any issues. However, when I try to run the same code on a real device such as an iPad 12.5.7 or iPhone 16.2, I encounter these errors.
i want to print a qrcode.
insert the code outside of class
final result = zx.encodeBarcode( 'Text to encode', format: Format.qrCode, width: 300, height: 300, margin: 10, eccLevel: 0, );
put this code in the _MyHomePageState build function
final imglib.Image img;
Uint8List encodedBytes = Uint8List.fromList([0]);
if (result.isValid && result.data != null) {
img = imglib.Image.fromBytes(300, 100, result.data!.toList());
encodedBytes = Uint8List.fromList(imglib.encodeJpg(img));
// use encodedBytes as you wish
}
console:
frame #0: 0x00000001043110f4 Flutter
dart::BootstrapNatives::DN_TypedData_GetInt8(dart::Thread*, dart::Zone*, dart::NativeArguments*) + 300 Flutter
dart::BootstrapNatives::DN_TypedData_GetInt8:-> 0x1043110f4 <+300>: ldrsb x8, [x0, x21]
0x1043110f8 <+304>: lsl x0, x8, Image in memory, points QRCODE #1
0x1043110fc <+308>: ldp x29, x30, [sp, #0x20]
0x104311100 <+312>: ldp x20, x19, [sp, #0x10]
Target 0: (Runner) stopped.
flutter version:3.3.10
library version:^0.9.0
ios:15.1
The text was updated successfully, but these errors were encountered: