Closed teolemon closed 1 year ago
It isn't working for me too 🤕
We didn't change anything directly on the scanner. It could be that the underlying code has changed
I'm about to start a new simple flutter project from scratch: just a barcode scanner. This way I would be able to work on android.
As @M123-dev suggested I guess @g123k's forks were side-effected by the upgrade to flutter 3.7, but we cannot stay forever on flutter 3.0.5 or hold our breath each time we want to upgrade flutter.
Besides, I really find the UI/UX about scanning is not optimal for the user, and definitely problematic for us developers. I would prefer a "scan!" button that would detect a barcode only when needed. But that's another story.
My first attempt to use qr_code_scanner was successful (their example), even on my canary smartphone:
There were probably good reasons for coding a more complex barcode scanner in Smoothie. I never worked on the camera-related classes for Smoothie, and I don't know if those reasons are still relevant today. Are they?
@teolemon @M123-dev Please run the qr_code_scanner example and check if it works on your devices.
Is it using CameraX?
Is it using CameraX?
Since the underlying frameworks of this package, zxing for android and MTBBarcodescanner for iOS are both not longer maintaned, this plugin is no longer up to date and in maintenance mode only. Only bug fixes and minor enhancements will be considered.
I am developing a new plugin mobile_scanner that uses the latest version of MLKit for detecting barcodes and QR codes. On Android it also uses the latest version of CameraX, and on iOS the native AVFoundation for best camera performance.
To be honest, I have no clue about CameraX and MLKit, and from outside I haven't seen the point to all that jazz.
That said, I'm about to test mobile_scanner
too. I'll die less stupid.
[ ] CameraX aims at standardizing the Android camera clusterf**k
[ ] MLKit is independent and normally offers better perf than axing
The Flutter team has promised in Flutter Extended they would make CameraX the default sometime this year.
The thing is there's no official implementation mixing properly the two (CameraX + MLKit)
We've been using Camera2+MLKit
I've been tracking a bunch of other packages as well:
@teolemon What I can tell you is that qr_code_scanner
works right out of the box, even on my phone, in the very same conditions as Smoothie (forever barcode scanning on top of the screen, with pause/resume methods).
mobile_scanner
does not work without some rewriting, as the example
do not match the code of the package.
camerawesome
has no example related to barcode scanning.
That said, I don't have your experience with the android legacy off app and the probable issues regarding cameras and barcode scans.
The Flutter team has promised in Flutter Extended they would make CameraX the default sometime this year.
If I were French or cynical I would say that everything is fine then, the issue will then probably be fixed sometime this year.
@teolemon I took me 1 hour to integrate qr_code_scanner
into Smoothie, and it works perfectly on my canary smartphone.
Of course it should be tested on other devices.
The code would be so much easier and the app would be lighter if we used qr_code_scanner
. As an expected bonus the camera and barcode scan will work, which doesn't seem to be the case today on all devices.
I'm scratching my head wondering why we should keep the MLKit and ZXing confusion (or perhaps in an experimental app).
Tell me if you want me to PR the qr_code_scanner
version.
Fun fact: with the current scan system it takes me 30 minutes (!) to build the debug app on my old samsung. It takes me less than 2 minutes with qr_code_scanner
instead.
I'm going to PR a qr_code_scanner
version where I've blowtorched anything related to mlkit and zxing. Even if it's not merged in the end, at least I could use the app, and you guys will be able to test it. And that would be part of #3669.
That definitely sounds like an improvement in terms of developer usage. It would be good if you could somehow integrate it into the current system. At best, a switch in the dev settings to test both.
The main problem for most barcode scanner packages is that we don't have enough ways to configure it.
@M123-dev Do you realize that I used Smoothie today in a supermarket. Last time I could was maybe one year ago., maybe more.
For the moment I'm still in the process of making qr_code_scanner
work completely in the app (with flash on/off, ...).
And that means I deleted a lot of now unused files.
We'll see first if it works on actual devices, before possibly merging.
Does it match the current way of coding: unfortunately no. The thing is that IMHO the current way of coding the scanner is a bit experimental. And it should be a black box, as packages in pub.dev:
So if the idea is to use MLkit (still a bit mysterious to me, but let's be positive), the best way would be to develop a flutter Widget
in a specific open source package, that opens the camera and scans barcodes.
This way other developers would be able to reuse that package, and the code would be easy to reuse.
Currently that's not the case: there are bits of code here and there.
That's great to hear and I completely agree, a full working system would be amazing, to either have or if we make it ourselves we can share it.
For the whole system, maybe we could get help from Google for it cc @teolemon
Ok, not working any better…
@teolemon Probably #3642 would need to be reverted too. Have you downgraded to flutter 3.0.5?
@M123-dev Could you revert #3642 ? Thank you!
Good news @monsieurtanuki scan now works again not saying we should forget about this but it works for the time being
That's good! I guess we're now ready to release a new Smoothie version with the packaging-grams-with-numeric-keyboard bug fix.
Sorry I've been in an ecoscore conference all day. Will try to test on the train back tomorrow morning
Ok, just verified it works @stephanegigandet @monsieurtanuki @M123-dev going to take my laptop and proceed to release at 300km/hr for one of our fastest releases ever.
Rolling out on Android, Under validation for Apple
Wonderful, thanks a lot everyone!
Closing, to be followed in #3712
What