Closed kaboc closed 10 months ago
I suspected that it might be because of the aspect ratio on a wider screen, but it does not seem to be the direct cause. I don't see the issue on Android 10 even if I change the aspect ratio to be wider.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: AspectRatio(
aspectRatio: 3 / 4,
child: ReaderWidget(
onScan: (_) {},
),
),
),
);
}
I noticed this issue was due to a bug of package:camera. The aspect ratio changes when startImageStream()
is called. So I searched related for bug reports in the Flutter repo on GitHub and found this.
None of the workarounds written in the page worked for me. There may be no choice but to wait for the bug to be fixed. It looks like the issue has been around for almost five years...
I appreciate your thorough investigation into this issue. It's frustrating to see that the problem has persisted for so long. I'll take note of this and will proceed to close the issue. If there are any updates or changes in the future, we can reopen it. Thank you for your patience!
The red box in the screenshot below is a square, but it is shown as a rectangular on Android 5.1. It does not happen on my another phone with Android 10. I'm not really sure if it is related to Android versions though, because I have only those two real devices.
It didn't happen on the same device when I was using another QR scanner plugin.
Environment:
Reproducible code:
Screenshot: