Closed ttb-inc closed 3 months ago
A version that was working fine before also throws an error. I think there is a conflict with the Android OS or the Flutter SDK.
By the way, if it delays the breakpoint a bit before building, It works fine.
It definitely works the first time. The second time it doesn't.
I used startDelay: true and it worked fine.
We are creating a new instance and outputting it as an independent Widget View, not a PageView.
Is this the right way to use it?
Thank you.
[My code]
Scaffold(
body: SafeArea(
child: Stack(
children: [
/// scanner
MobileScanner(
controller: MobileScannerController(formats: [BarcodeFormat.qrCode]),
startDelay: true, // <-- new flag
onDetect: (BarcodeCapture barcodes) {
if (detectedCode != null) {
return;
}
if (barcodes.barcodes.isNotEmpty) {
detectedCode = barcodes.barcodes[0].rawValue ?? '';
if (widget.onDetect != null) {
widget.onDetect!(detectedCode);
}
pop();
}
},
scanWindow: scanWindow,
),
/// scanner overlay
RepaintBoundary(
child: CustomPaint(
painter: _ScannerOverlay(
scanWindow: scanWindow,
color: widget.themeColor,
radius: widget.viewFinderRadius,
strokeWidth: widget.viewFinderStrokeWidth,
canScanLine: widget.canScanLine,
scanLineColor: widget.scanLineColor,
scanLineStrokeWidth: widget.scanLineStrokeWidth,
),
),
),
/// overlay Widget
widget.overlayWidget,
],
),
),
);
Is there any way to handle startDelay: true when the camera is shut down, not when it starts up? If it could be pre-initialized, it would be a little faster on the next run.
Thank you.
This seems to be related? https://github.com/flutter/flutter/issues/138947
The issue seems to be fixed on the master channel at the moment, so this will be included in the next Flutter stable release, that is due sometime this month. If you switch to the master channel, does the issue occur?
Is 'startDelay: true' just a time delay? Is it 1.5s? It certainly seems like a long time, is there a reason?
if (widget.startDelay) {
await Future.delayed(const Duration(seconds: 1, milliseconds: 500));
}
This seems to be related? flutter/flutter#138947
The issue seems to be fixed on the master channel at the moment, so this will be included in the next Flutter stable release, that is due sometime this month. If you switch to the master channel, does the issue occur?
I haven't checked the github master version yet. I'll check the master version or wait for the next patch.
Thank you.
The start delay is an older parameter that was left in from older releases.
It will be removed in the next major release.
This seems to be related? flutter/flutter#138947
The issue seems to be fixed on the master channel at the moment, so this will be included in the next Flutter stable release, that is due sometime this month. If you switch to the master channel, does the issue occur?
I've verified that it works on the master version. Hopefully it will work with the next update.
Thanks a lot.
[✓] Flutter (Channel master, 3.20.0-2.0.pre.18, on macOS 14.3 23D56 darwin-arm64, locale ko-KR)
• Flutter version 3.20.0-2.0.pre.18 on channel master at /Users/jeonglockpark/Desktop/work/flutter_sdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 0903bf7055 (4 hours ago), 2024-02-05 21:42:40 -0800
• Engine revision 808886312e
• Dart version 3.4.0 (build 3.4.0-104.0.dev)
• DevTools version 2.32.0
I'll keep this issue open and will monitor for the stable release. Once that lands and the fix is verified to be in stable, we can close this issue.
I'll keep this issue open and will monitor for the stable release. Once that lands and the fix is verified to be in stable, we can close this issue.
I've checked the stable version and found no issues.
[✓] Flutter (Channel stable, 3.19.0, on macOS 14.3.1 23D60 darwin-arm64, locale ko-KR)
Thanks a lot.
Hi,
An error occurs on the Android device. The first time you run the camera, there is no error, but the second time, there is an error.
This hadn't happened before. This is a recent error.
Why is this error occurring?
[My env.] mobile_scanner: 4.0.0 # https://pub.dev/packages/mobile_scanner/versions
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.3 23D56 darwin-arm64, locale ko-KR) • Flutter version 3.16.9 on channel stable at /Users/jeonglockpark/Desktop/work/flutter_sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 41456452f2 (11 days ago), 2024-01-25 10:06:23 -0800 • Engine revision f40e976bed • Dart version 3.2.6 • DevTools version 2.28.5
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/jeonglockpark/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C500b • CocoaPods version 1.15.0
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.86.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (4 available) • SM A125N (mobile) • R59R700M14X • android-arm64 • Android 12 (API 31) • Chrome (web) • chrome • web-javascript • Google Chrome 121.0.6167.139
[✓] Network resources • All expected network resources are available.
• No issues found!