Open longtimedeveloper opened 6 months ago
@RafaelBarbosatec do you have any ideas or suggestions to correct this?
We want to go live with our application, but I have concerns, so at the moment so we are waiting for your thoughts before going live.
I am serving in Ukraine under terrible circumstances and need to go live. Thank you!
Hi @longtimedeveloper ! I'm sorry for late. I will try take a look today.
I'm sorry, I'm can’t reproduce this problem.
I updated the dependencies, maybe it solve this problem.
Version 0.7.4
available
I'm sorry, I'm can’t reproduce this problem. I updated the dependencies, maybe it solve this problem. Version
0.7.4
available
I'll test now and let you know.
@RafaelBarbosatec
example.zip I just updated the scan qr code code to the latest. I have attached your example app in the zip file.
When running the app on Android, I still get the same messages in the Debug Console after scanning the bar code. They continue being added.
@RafaelBarbosatec my Flutter Doctor
@RafaelBarbosatec there are more dependencies that could be updated in the scan qr code package.
@RafaelBarbosatec maybe you can update these camera dependencies?
This dependencies don't have connections with this problem. For some reason in your test, when you navigate to other screen, the camera screen it's not disposed. Try do navitation.pop() with the qrcode when it's captureted instead of navigate to other screen.
@RafaelBarbosatec I am using Navigator.pop(context, result) on Capture.
import 'package:flutter/material.dart';
import 'package:qr_code_dart_scan/qr_code_dart_scan.dart';
class LiveDecodePage extends StatefulWidget {
const LiveDecodePage({Key? key}) : super(key: key);
@override
_LiveDecodePageState createState() => _LiveDecodePageState();
}
class _LiveDecodePageState extends State<LiveDecodePage> {
Result? currentResult;
@override
Widget build(BuildContext context) {
return Scaffold(
body: QRCodeDartScanView(
scanInvertedQRCode: false,
onCapture: (Result result) {
setState(() {
Navigator.pop(context, result);
});
},
),
);
}
}
@RafaelBarbosatec I just tried using a StatelessWidget and not passing the Result object back, instead pass the string in the Navigator.pop(). Still have the same issues with the messages continuing in the Debug Console.
import 'package:flutter/material.dart';
import 'package:qr_code_dart_scan/qr_code_dart_scan.dart';
class LiveDecodePage extends StatelessWidget {
const LiveDecodePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: QRCodeDartScanView(
scanInvertedQRCode: false,
onCapture: (Result result) {
var resultText = '';
resultText = result.text;
Navigator.pop(context, resultText);
},
),
);
}
}
@RafaelBarbosatec any progress?
Hi @longtimedeveloper!
I don't know why this problem persist in your device. I can't reproduce it. anyway I will be adding the methos dispose
in QRCodeDartScanController
to you try do dispose manually.
@RafaelBarbosatec I have stepped through the code when Navigator.pop(context, resultText);
is invoked. Your QRCodeDartScanView
widget's dispose
method is invoked.
Maybe could be a 'camera' plugin bug in some devices. I already try it on Xiaomi k20 and a Samsung and work well.
@RafaelBarbosatec my apartment here in Kherson, Ukraine was hit on Saturday. I am OK. Thankfully no one was injured or killed because most apartments are vacant. My internet has been down since the strike because the cables were blown off the building.
I once I have internet, I'll write a small app that uses the camera plugins you are using and see if I still have the same problems and will let you know. Hopefully my internet will get fixed very soon.
Thank you for trying and helping.
Hi @longtimedeveloper ! 😳 How horrible, I hope you and your family are well! Thanks so much for your reporting. In parallel I'm take a look in this case in my free time. Anything I'll notify you!
@RafaelBarbosatec My internet was restored this morning. :-)
I created an Android app using the same Camera Plugin Scan QR code uses. I did not have the same messages in the debug console.
I spent an hour debugging and trying different code techniques to get the Scan QR Code example to not continue to add the reported messages to the debug console. I was unsuccessful.
Maybe you'll have better luck than I did. Thank you for trying.
This is a build warning I get. This warning was covered in this Flutter Release Note. If you have time, maybe you can update the Example app for future Flutter developers using the package.
''' You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
You are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply '''
Hi @longtimedeveloper !
In the develop
branch I updated the android example. It's crazy, but I don't reproduce this problem in my device yet.
@RafaelBarbosatec thank you for trying. I'll let my team know to close the app after they use it. This way we won't have any possible negative side effects. When I get more time, I'll try to write a version of Scan QR code that does what I need. If I can get it to work without the messages, I'll send you a link to the app for to look at. Maybe it could help? Maybe I am the only one with this issue? Next week, I have someone coming with an iOS device. We will run it in debug mode and see if we get the same results.
Best to you, and thanks again for a great QR Code Scanner.
Thank's @longtimedeveloper ! Perfect, I stay waiting. This appears to be a problem on Samsung devices. I use this package in my job and we don't have this problem. It's really strange. Any news or solution I find. I will be adding it to the package.
After using Scan QR Code once and closing the Widget many messages keep appearing in the debug console. See example messages below the code.
I show this widget and then close it.
I am about to go live with the project, but am concerned about memory leaks.
When I navigate to this widget, I am not maintaining state. See navigation code below the widget.
Is there something I am not doing correctly? It seems strange that I keep getting these messages after closing this widget and navigating to other pages in the app.
Thank you for you assistance.
My Code
Navigation Code
Debug Console Messages - they never stop, just keep being added to the console.
I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_ACTIVE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_IDLE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_OPEN for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_ACTIVE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_IDLE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_OPEN for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_ACTIVE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_IDLE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_OPEN for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_ACTIVE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_IDLE for client com.samsung.adaptivebrightnessgo API Level 2User Id 0 I/CameraManagerGlobal(20308): Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for client com.samsung.adaptivebrightnessgo API Level 2User Id 0