zxing-dart
zxing-dart copied to clipboard
Example App is broken
The current example app seems not to be working.
I believe you have to call "initialize()" before getting the image stream.
Keep broken for me
E/flutter ( 6392): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: RangeError (index): Index out of range: index should be less than 460852: 460852
E/flutter ( 6392): #0 _Int32ArrayView.[] (dart:typed_data-patch/typed_data_patch.dart:4260:7)
E/flutter ( 6392): #1 new RGBLuminanceSource (package:zxing2/src/rgb_luminance_source.dart:28:25)
E/flutter ( 6392): #2 decode (package:zxing2_example/decode.dart:7:28)
E/flutter ( 6392): #3 _CameraAppState.initState.<anonymous closure>.<anonymous closure> (package:zxing2_example/main.dart:37:23)
E/flutter ( 6392): #4 CameraController.startImageStream.<anonymous closure> (package:camera/src/camera_controller.dart:395:20)
E/flutter ( 6392): #5 _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter ( 6392): #6 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter ( 6392): #7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
E/flutter ( 6392): #8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
E/flutter ( 6392): #9 _DelayedData.perform (dart:async/stream_impl.dart:591:14)
E/flutter ( 6392): #10 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
E/flutter ( 6392): #11 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
E/flutter ( 6392): #12 _rootRun (dart:async/zone.dart:1346:47)
E/flutter ( 6392): #13 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter ( 6392): #14 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter ( 6392): #15 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1202:23)
E/flutter ( 6392): #16 _rootRun (dart:async/zone.dart:1354:13)
E/flutter ( 6392): #17 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter ( 6392): #18 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
E/flutter ( 6392): #19 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1202:23)
E/flutter ( 6392): #20 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter ( 6392): #21 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
I'm using the dart image package to get my luminance and I've had it work great.
in brach xha/fix_example only remove this comments:

I'm trying use this package with the camera.
Converted fromCameraImage to Image and it worked. But its only work with ResolutionPreset.high.
In this way, there is a lot of lag on the phone. This decode is probably too expensive. Is there any way I can do this process using isolate or something?
Do you have any recommendations?
I got it. serialized ImageCamera to work with isolate. and it was beautiful!
https://pub.dev/packages/zxing2/example do not using ZXing at all!! Nice to look it as an example ))