carterapp / vision_camera Goto Github PK
View Code? Open in Web Editor NEWFlutter plugin for detecting barcodes using Google's Mobile Vision
License: BSD 3-Clause "New" or "Revised" License
Flutter plugin for detecting barcodes using Google's Mobile Vision
License: BSD 3-Clause "New" or "Revised" License
Hi there. I've tried to use your plugin example to get the barcode scanning working.
I downloaded the package, did a flutter packages get
and replaced line 60 with the following:
...
controller =
new CameraController(newValue, ResolutionPreset.high, OptionsAndEventTestClass.options);
await controller.initialize();
...
I made a class, OptionsAndEventTestClass
that returns the options that the controller asks for (from reading the camera.dart
file and reverse-engineering it):
import 'package:flutter/material.dart';
import 'package:vision_camera/vision_camera.dart';
class OptionsAndEventTestClass{
static Map<String, String> get event {
final Map<String, String> event = <String, String>{};
event['eventType'] = 'barcodes';
return event;
}
static Map get options {
final Map<String, Function> options = <String, Function>{};
options['onBarcodeRead'] = (Iterable<Barcode> barcodes) => barcodes.forEach(
(Barcode barcode) => debugPrint(
'BARCODE\n toString:\t${barcode.toString()}\n rawValue:\t${barcode.rawValue}\n format:\t${barcode.format}'));
return options;
}
}
When I run the app, I can see my front- and back-facing cameras. Activating either and taking pictures works, but whenever I put it in front of a QR- or barcode, it doesn't trigger my callback. When breakpointing on the _listener()
function in the camera.dart
package, it never gets triggered.
Am I doing something wrong or is this package broken, perhaps?
I need this package (or something similar) for an app that I'm building for a startup, so a quick response would be greatly appreciated.
Thank you in advance.
Best, Jeroen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.