-
-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade the barcode scan to flutter 3.7 #3712
Comments
I found:
|
Thank you @Adiii1436 for your research! In that particular case the problem is not to have a barcode scanner that works - I did it in #3694 (based on qr_code_scanner), then had to revert it. The idea is to refactor our current implementation so that it works in 3.7. For some reason we have to support both MLKit (better but google related) and zxing (not google related so acceptable in no-google zones), in different app flavors. We also have to deal with camera quality and performances, which are better with native packages, but barcode scan packages include both the camera and the image processor. As we need to support MLKit and zxing, we should have a native camera on one part, that calls an abstract image processor implemented by MLKit and zxing on another part. The point is to get access to our barcode scanner code to make it work in 3.7 and to improve its maintainability. |
I want to work on this problem. Can you please assign it to me? |
@abhinav52000 the first step is to understand the current implementation, so please have a look at it. |
I went through it and tough and found that in order to update one Barcode scanner package we primarily need to update various other as well. |
@abhinav52000 The goal would be to code clean OOP, something like that:
So the first step would be to split the current implementation in 3: an autonomous widget called from the home page, that uses a camera preview and a barcode scan algorithm. Could you have a look at it? |
I went through it And however tried to get the packages but some of the packages are not being resolved even in flutter version 3.0.5. So is there any extra thing I am supposed to know in order to start the implementation for this? |
@abhinav52000 Try flutter clean. And it's not about starting an implementation from scratch but rather refactoring existing code. |
Sure then I am on it try to do the required |
Heyy @monsieurtanuki I've seen you just forked juliansteenbakker/mobile_scanner, just FYK we talked about the scanner situation in today's meeting, with the outcome to test different scanner implementations in the dev mode. Not fully implemented, that's too hard. Just dumping a MVP in it to test on android and especially iOS. Also, it should be easy to "comment out" to not make the production app size bigger than needed |
@M123-dev Dammit, you're a real spy ! ;) I've just read the google docs - I assume it includes the latest comments after your meeting. That's why I forked. I can already say that As for the tap dancing about the size of the app, I'm not sure using the "light" version makes sense. It looks like whatever we don't integrate in the app, we'll have to download async'ly at init. That would mean no barcode scan immediately available... And besides, the "light" mode trick would have to be maintained. That said, if the size of the app is really problematic, I suggest to create a specific issue that tracks the app version sizes, and if possible the size of code vs. assets. |
GitHub just presents me some infos they think is interesting on the front page and since I follow you this was present directly in my view ;-D
Sounds promising
ohh I guess I didn't put it clearly. I don't mean downloading the stuff after the install, I just mean that we should put all the scanners we're testing into the app loose first. So that we can test it on iOS and don't need lots of test apks for android. However, making it easy for us to remove them temporally without effort. We can upload 5 different scanners in test versions of the app, but should limit ourselves to one when we promote to production. |
@M123-dev I'm about to integrate |
I've managed to make both MLKit and ZXing work on my low-end smartphone, in flutter 3.7. |
I've managed to display zxing full screen. @M123-dev I guess we could even add a "switch barcode scanner" button on that home page (only for dev mode users), that could switch among mlkit/zxing/no scanner/numeric keyboard.
|
@monsieurtanuki looks fine at a first glance, I guess the spacing will look not so crowded on a somewhat bigger display Some things to consider;
|
@M123-dev The screen will look as crowded as we want it to. The screenshots say roughly 45% for the scanner and 55% for the carousel. The old implementation is not intact. The scanning rectangle is a parameter of both new scanners, and I assume that the focus point takes that into consideration. |
Issues about focus, scan and camera, that were created in the last 12 months. #3731 - User reviews in bulk
#3674 - Pixelated camera
#3670 - I can't scan anything anymore
#3664 - Can't Scan item from camera properly ( Blur )
#3427 - Barcode Scanner with fdroid build does not work (zxing)
#3316 - We're getting black screens again
#3212 - Can't scan on galaxy s21 (mlkit)
#3196 - Infinite refocusing on a Pixel 6 with the dev branch (mlkit)
#2927 - App does not read barcode from camera on Sony Xperia 10 IV
#2917 - Camera crashes the app (Samsung) (mlkit)
#2916 - List of brands or models being affected by the scan issue
#2741 - We have a BIG scan issue
#2251 - Samsung devices do not seem able to focus (mlkit)
#1898 - Focus point is still in center
|
[Edited for clarity]
Redmi Note 8 pro |
@monsieurtanuki Awesome! It would be great to have a test app with both new scanners (even better would be to also have the old scanner so that we can easily compare the 3). Maybe to start with, we could just have a test APK, so that we can test it on the devices we have, see how well the new scanners are working on a variety of phones. |
@stephanegigandet Good idea! For the moment, I just need to:
I should be able to do that today. |
Maybe not, because of build confusion. |
Perfect, otherwise there shouldn't be a problem copying the whole scanning files and renaming the modifies ones: continuous_scan_page -> continuous_scan_page_zxing To also test them on iOS |
Does it work without |
@MKCOOL142 (OnePlus 7Pro), @teolemon (Pixel 6), @thestarsahil (Redmi Note 8 pro), @natrius (Xiaomi Mi 9 with Android 10), @M123-dev (Samsung galaxy s21), @raphael0202 (Oneplus 7T), @chk1 (Sony Xperia 10 IV), @monsieurtanuki (Samsung Galaxy Core Prime SM-G360F), @CharlesNepote (???), @g123k (ZFlip3), @stephanegigandet (Samsung Galaxy S8) Guys, the current |
@monsieurtanuki i am confused on where to select which of the two (Zxing MLkit) to use for scanning, I found nothing in the settings mby I overlooked it |
Still Facing the same Autofocus problem |
@MKCOOL142 @thestarsahil @natrius Be sure to use the latest If you're familiar with flutter, you can
I'm currently trying to create an |
Thanks for the update men |
@thestarsahil Do you mean it finally works?
Unfortunately I don't seem to be able to create that stupid apk. There are tons of thing I ignore about compiling - and I intend to keep it that way. |
(Re-opening for the discussion in here) Here a build apk ready to test, not for looks but for functionality. https://drive.google.com/file/d/1R2b_rbQuq9Lv-vGErU-8xdvmumQYwhcz/view?usp=sharing |
Not working properly Have some time to update |
@MKCOOL142 Possible reasons/fixes:
|
@thestarsahil Could you please be a little more specific about what works and what does not work, and with mlkit and zxing? |
Actually, When we try to scan the barcode the scanner couldn't recognize that information from the product |
Test on Sony Xperia 10 IV:
MLKIT:
Zxing:
|
@chk1 Could not reproduce the "no scanner after onboarding" bug with the latest code, with mlkit as default. |
I just installed the new version (4.6.0) using internal release on my cellphone (OnePlus 7T), it works really well using MLKit, scanning is superfast, good job! 🎉 |
@raphael0202 Sounds good but unfortunately there's a possible confusion with versions, so please test with https://drive.google.com/file/d/1R2b_rbQuq9Lv-vGErU-8xdvmumQYwhcz/view?usp=sharing |
Hi all, as the developer of the mobile_scanner package i am happy to help with any issues regarding the package. A quick note about some people having trouble getting the correct barcode from a scan: The MLKit framework decides which resolution is used for an image to be analyzed, and i have found out that this can be to low on some devices. I'm currently trying to find a solution by using some kind of 'quality presets', so we can improve scan accuracy on all devices. |
Thank you @juliansteenbakker! If you could make it optional we'll have a better assessment of the actual impact of that fine-tuning. |
This issue is closed now: we do have 2 barcode scanners (mlkit and zxing) working on flutter 3.7. |
What
Steps to reproduce the behavior
Expected behavior
The barcode scan is supposed to work.
Why
The barcode scan is a key feature of Smoothie.
Additional context
Icing on the cake would be to refactor the barcode scan:
flutter run
start time) as - I suppose - the code was local and less complex. The PR worked very well and fixed a dozen of issues, including P0, but I had to close it because it discarded most of the current barcode scan code. The current barcode scan code is embedded in the rest of the code - you cannot touch it without touching the rest of the app - and should be completely isolated in a package instead.camera
package doesn't seem to work very well either (cf. Pixelated camera #3674), and I recommend using native camera code.flutter run
takes 30 minutes and when I reload the app it crashes)The text was updated successfully, but these errors were encountered: