facundomedica / fast_qr_reader_view

A Fast QR Reader widget for Flutter. For both Android and iOS
MIT License
295 stars 163 forks source link

scan other kinds of barcodes? #1

Closed ghunter99 closed 5 years ago

ghunter99 commented 5 years ago

Great job with this plug in! Do you have any interest in making the plug in work with other kinds of barcodes? Thinking that it would be relatively straight forward :) & would widen it's appeal.

facundomedica commented 5 years ago

Thanks for opening this issue, I was going to open it myself as a reminder. Yes, scanning other codes is definitely in my plans, and as you said it should be quite easy. An enum in the dart interface and a handler (a for loop that adds the accepted types to an array) for that in each platform code should do the trick.

Let me know if you would like to send a pull request for this, if not, I'll try to tackle this during the week.

If you have other suggestions feel free to open issues!

facundomedica commented 5 years ago

I've already implemented this, but I don't have an iPhone to test it at the moment. I will push it to Github so you can give it a try. After I tested it I will publish to pub.dartlang.org.

Can you test it and give me feedback? Thanks!

facundomedica commented 5 years ago

Ok, I fixed the iOS scanning and pushed everything.

Now you have to pass an array of CodeFormat when the controller is initialized. The reason why I chose to do this instead of just scanning everything is because it's faster. If I had just let it scan everything, things would be much slower for people who just wants to scan one or two code formats.

Reference:

Scan for all supported barcode formats at once, without having to specify the format you're looking for. Or, boost scanning speed by restricting the detector to only the formats you're interested in.

https://firebase.google.com/docs/ml-kit/read-barcodes?hl=en