siridx / qrcode Goto Github PK
View Code? Open in Web Editor NEWA flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
License: MIT License
A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
License: MIT License
can also return the current picture when get the result?
First of all, thank you for the library. It's one of the very few libraries that you can fit camera view in a widget with working torch plus it doesn't require android minumum sdk 21.
So everything worked perfectly in Android. But I encountered the problem where I can't quite set width and height of the QRCaptureView in iOS. I treid to wrap in Container but the QRCaptureView always has the defualt size that fit between my appbar and bottom navigation bar that I have in my app then it would ignore container width and height and go across the boundary. So it doesn't cover entrie screen but I can't get it smaller. I tested on iPhone5s and 8.
I've noticed that it doesn't support barcode format in iOS, while it does in Android. I know the library is created for scanning qr code but would it be also possible to support barcode format on iOS?
Here's the scenario:
-start the plugin, and given that you've configured your iOS app correctly, it'll start the camera.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureSession addInput:] Can't add a nil AVCaptureInput'
*** First throw call stack:
(0x199a2d86c 0x1aea48c50 0x1b3dbfba4 0x100992208 0x100991dc4 0x100992a78 0x100a9deac 0x100a99400 0x100daea60 0x100abfd7c 0x100dc9070 0x100d631d4 0x100d659fc 0x1999a9fa0 0x1999a9ba0 0x1999a8ffc 0x1999a2ee4 0x1999a221c 0x1b156e784 0x19c3e2ee8 0x19c3e875c 0x1004f76d0 0x1996626b0)
libc++abi.dylib: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001c7982414 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
-> 0x1c7982414 <+8>: b.lo 0x1c7982434 ; <+40>
0x1c7982418 <+12>: pacibsp
0x1c798241c <+16>: stp x29, x30, [sp, #-0x10]!
0x1c7982420 <+20>: mov x29, sp
Target 0: (Runner) stopped.
Lost connection to device.
Since the latest stable version of Flutter 1.22 the embedded view support is out of preview.
So these lines:
<key>io.flutter.embedded_views_preview</key>
<true/>
can be removed from README
Some devices throw a divide by zero exception, mostly present in Huawei and Samsung devices.
Camera is shown correctly and qr codes are scanned correctly too.
Fatal Exception: java.lang.ArithmeticException: divide by zero
at com.journeyapps.barcodescanner.CameraPreview.calculateFrames(CameraPreview.java:389)
at com.journeyapps.barcodescanner.CameraPreview.previewSized(CameraPreview.java:461)
at com.journeyapps.barcodescanner.CameraPreview.access$300(CameraPreview.java:59)
at com.journeyapps.barcodescanner.CameraPreview$3.handleMessage(CameraPreview.java:199)
at android.os.Handler.dispatchMessage(Handler.java:108)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
I need to know if this project is still maintained and if not the case what is the recommandation / alternative to another plugin with similar features / performances / device compatibility (ios/android/web).
This plugin is very nice and that's a shame to be obliged to changed !
Tx for the great job
java.lang.NoSuchMethodError: No interface method sort(Ljava/util/Comparator;)V in class Ljava/util/List; or its super classes (declaration of 'java.util.List' appears in /system/framework/core-libart.jar)
当在TextField组件的suffixIcon设置点击事件时,因为键盘谈起的原因,导致调出的扫码界面黑屏。
version: qrcode: ^1.0.4
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.6 19G73, locale en-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Android Studio (version 4.0)
[✓] Connected device (1 available)
• No issues found!
代码:此处为TextField中的代码,其他没有键盘弹起的地方调用扫码界面,完全正常。
suffixIcon: InkWell(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () {
JumpReceive()
.jump(context, Routes.deliveryOrderScanQrPage)
.then((value) {
print('扫码结果》》》》' + value);
setState(() {
_codeController.text = value;
});
});
},
child: Container(
padding: EdgeInsets.only(
top: AutoLayout.instance.pxToDp(12),
bottom: AutoLayout.instance.pxToDp(12)),
width: ScreenUtil().setWidth(36),
child: Image.asset('images/search_scan_icon.png'),
),
),
结果:
I/CameraConfiguration(28320): Can set flash mode to: off
I/CameraConfiguration(28320): Flash mode already set to off
I/PreviewScalingStrategy(28320): Viewfinder size: 1722x1080
I/PreviewScalingStrategy(28320): Preview in order of preference: [1920x1080, 1440x1080, 1280x960, 1280x720, 800x480, 864x480, 720x480, 640x480, 640x360, 576x432, 480x320, 480x360, 352x288, 320x240, 176x144]
I/CameraManager(28320): Final camera parameters: ae-bracket-hdr=Off;ae-bracket-hdr-values=Off,AE-Bracket;antibanding=off;antibanding-values=off,60hz,50hz,auto;auto-exposure=frame-average;auto-exposure-lock=false;auto-exposure-lock-supported=true;auto-exposure-values=frame-average,center-weighted,spot-metering,center-weighted,spot-metering-adv,center-weighted-adv;auto-hdr-supported=true;auto-whitebalance-lock=false;auto-whitebalance-lock-supported=true;avtimer=disable;bokeh-blur-value=0;bokeh-mode=0;bokeh-mpo-mode=0;brightness-step=1;cache-video-buffers=enable;camera-mode=0;cds-mode-values=off,on,auto;contrast=5;contrast-step=1;denoise=denoise-on;denoise-values=denoise-off,denoise-on;dis=disable;dis-values=enable,disable;effect=none;effect-values=none,mono,negative,solarize,sepia,posterize,whiteboard,blackboard,aqua,emboss,sketch,neon;exposure-compensation=0;exposure-compensation-step=0.166667;face-detection=on;face-detection-values=off,on;finetune-values=enable,disable;flash-mode=off;flash-mode-values=off,auto,on,torch;flip-mode-values=off,flip-v,flip-h,flip-vh;focal-length=3.82;focus-areas=(0, 0, 0, 0, 0);focus-distances=Infinity,Infinity,Infinity;focus-mode=auto;focus-mode-values=auto,infinity,fixed,macro,continuous-video,continuous-picture,manual;hdr-mode=hdr-mode-multiframe;hdr-mode-values=hdr-mode-sensor,hdr-mode-multiframe;hdr-need-1x=false;hdr-need-1x-values=false,true;hfr-size-values=1920x1080;histogram=disable;histogram-values=enable,disable;horizontal-view-angle=65.5;instant-aec-values=0,1,2;instant-capture-values=0,1,2;internal-restart=true;is-bokeh-mpo-supported=0;is-bokeh-supported=0;iso=auto;iso-values=auto,ISO_HJR,ISO100,ISO200,ISO400,ISO800,ISO1600,ISO3200;jpeg-quality=85;jpeg-thumbnail-height=154;jpeg-thumbnail-quality=85;jpeg-thumbnail-size-values=256x154,240x160,320x320,320x240,256x144,240x144,176x144,240x320,144x176,0x0;jpeg-thumbnail-width=256;lensshade=enable;lensshade-values=enable,disable;long-shot=off;longshot-supported=true;luma-adaptation=3;manual-exposure-modes=off,exp-time-priority,iso-priority,user-setting;manual-focus-modes=off,scale-mode,diopter-mode;manual-wb-modes=off,color-temperature,rbgb-gains;max-brightness=6;max-contrast=10;max-exposure-compensation=12;max-exposure-time=59498.796800;max-focus-pos-dac=1023;max-focus-pos-diopter=11.1111;max-focus-pos-index=1023;max-focus-pos-ratio=100;max-iso=1600;max-num-detected-faces-hw=10;max-num-detected-faces-sw=10;max-num-focus-areas=1;max-num-metering-areas=10;max-saturation=10;max-sce-factor=100;max-sharpness=36;max-wb-cct=8000;max-wb-gain=4;max-zoom=199;mce=enable;mce-values=enable,disable;metadata-types=metadata-asd,metadata-fd,metadata-hdr,metadata-led-calib,metadata-rtb;metering-areas=(0, 0, 0, 0, 0);mi-hdr=false;min-brightness=0;min-contrast=0;min-exposure-compensation=-12;min-exposure-time=0.019681;min-focus-pos-dac=0;min-focus-pos-diopter=0;min-focus-pos-index=0;min-focus-pos-ratio=0;min-iso=100;min-saturation=0;min-sce-factor=-100;min-sharpness=0;min-wb-cct=2000;min-wb-gain=1;morpho-hht=false;num-retro-burst-per-shutter=0;num-snaps-per-shutter=1;ois=enable;ois-values=enable,disable;picture-format=jpeg;picture-format-values=jpeg,bayer-mipi-10rggb;picture-size=4032x3016;picture-size-values=4032x3016,4000x3000,4000x2250,3840x2160,2976x2976,3264x2448,3200x2400,2592x1944,2688x1512,2304x1728,2048x1536,1920x1080,1600x1200,1440x1080,1280x960,1280x768,1280x720,1024x768,800x600,864x480,800x480,720x480,640x480,640x360,480x360,480x320,352x288,320x240,176x144;preferred-preview-size-for-video=1920x1080;preview-flip=off;preview-format=yuv420sp;preview-format-values=yuv420sp,yuv420p,nv12-venus;preview-fps-range=7000,30000;preview-fps-range-values=(15000,15000),(20000,20000),(24000,24000),(7000,30000),(30000,30000),(10000,30000);preview-frame-rate=30;preview-frame-rate-values=7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30;preview-size-values=1920x1080,1440x1080,1280x960,1280x720,864x480,800x480,720x480,640x480,640x360,576x432,480x360,480x320,352x288,320x240,176x144;qc-max-num-requested-faces=10;raw-size=4032x3
I/CenterCropStrategy(28320): Preview: 1080x1920; Scaled: 1080x1920; Want: 1080x1722
W/Looper (28320): Slow Looper main: doFrame is 491ms late because of 7 msg
I/CameraPreview(28320): Starting preview
D/CameraInstance(28320): Starting preview
I/AutoFocusManager(28320): Current focus mode 'auto'; use auto focus? true
I/utter_data_vie(28320): Background concurrent copying GC freed 3937(530KB) AllocSpace objects, 10(11MB) LOS objects, 49% free, 11MB/23MB, paused 117us total 114.070ms
I/utter_data_vie(28320): Background concurrent copying GC freed 3952(494KB) AllocSpace objects, 10(11MB) LOS objects, 49% free, 11MB/23MB, paused 290us total 110.101ms
I/utter_data_vie(28320): Background concurrent copying GC freed 7730(837KB) AllocSpace objects, 20(23MB) LOS objects, 49% free, 14MB/29MB, paused 136us total 104.821ms
I/utter_data_vie(28320): Background concurrent copying GC freed 4025(495KB) AllocSpace objects, 10(11MB) LOS objects, 50% free, 16MB/33MB, paused 186us total 114.647ms
I/utter_data_vie(28320): Background concurrent copying GC freed 3979(399KB) AllocSpace objects, 10(11MB) LOS objects, 50% free, 17MB/34MB, paused 170us total 108.899ms
I/utter_data_vie(28320): Background concurrent copying GC freed 4127(463KB) AllocSpace objects, 10(11MB) LOS objects, 50% free, 16MB/33MB, paused 179us total 108.284ms
I/utter_data_vie(28320): Background concurrent copying GC freed 8253(898KB) AllocSpace objects, 20(23MB) LOS objects, 50% free, 11MB/23MB, paused 163us total 111.790ms
I/utter_data_vie(28320): Background concurrent copying GC freed 4123(498KB) AllocSpace objects, 10(11MB) LOS objects, 49% free, 11MB/23MB, paused 122us total 103.371ms
I/utter_data_vie(28320): Background concurrent copying GC freed 4138(498KB) AllocSpace objects, 10(11MB) LOS objects, 49% free, 14MB/29MB, paused 353us total 116.915ms
I/utter_data_vie(28320): Background concurrent copying GC freed 8203(930KB) AllocSpace objects, 20(23MB) LOS objects, 49% free, 11MB/22MB, paused 165us total 102.431ms
I/utter_data_vie(28320): Background concurrent copying GC freed 4170(494KB) AllocSpace objects, 10(11MB) LOS objects, 49% free, 14MB/29MB, paused 140us total 102.820ms
有时还会异常退出。
测试手机:小米Note3
Hi,
pub get failed (1; Because xxx depends on qrcode ^1.0.5 which doesn't match any versions, version
solving failed.)
I want to disable the autofocus, @SiriDx, could you please help with this?
Will this library updated with null safety support?
when i start some times qrcode then it crash
Camera crash while my Android in landscape. Not tested on iOS yet.
I/CameraConfiguration(11983): Requesting focus mode value from among: [auto]
I/CameraConfiguration(11983): Supported focus mode values: [auto, infinity, macro, continuous-video, continuous-picture]
I/CameraConfiguration(11983): Can set focus mode to: auto
I/CameraConfiguration(11983): Focus mode already set to auto
I/CameraConfiguration(11983): Requesting flash mode value from among: [off]
I/CameraConfiguration(11983): Supported flash mode values: [off, auto, on, torch]
I/CameraConfiguration(11983): Can set flash mode to: off
I/CameraConfiguration(11983): Flash mode already set to off
I/PreviewScalingStrategy(11983): Viewfinder size: 0x0
I/PreviewScalingStrategy(11983): Preview in order of preference: [1920x1080, 1440x1080, 1088x1088, 1280x720, 1056x704, 1024x768, 960x720, 720x720, 720x480, 640x480, 352x288, 320x240, 256x144, 176x144]
I/CameraManager(11983): Final camera parameters: 3dnr=false;Infinity=Infinity;antibanding=50hz;antibanding-values=auto,50hz;auto-exposure-lock-supported=true;auto-whitebalance-lock-supported=true;best-capture=0;brightness=0;brightness-max=2;brightness-min=-2;burst-capture=0;burstshot-fps-values=(10,10);constant-growth-rate-zoom-supported=true;contrast=auto;drc=false;dual_mode=-1;dualrecording-hint=-1;dynamic-range-control=off;effect=none;effect-available-fps-values=(10000,24000);effect-values=none;effectrecording-hint=0;exif_exptime=0;exif_iso=0;exposure-compensation=0;exposure-compensation-step=0.1;exposure-time=0;fast-fps-mode=-1;flash-mode=off;flash-mode-values=off,auto,on,torch;fnumber-value-denominator=10;fnumber-value-numerator=19;focal-length=3.60;focallength-35mm-value=27;focallength-value-denominator=100;focallength-value-numerator=360;focus-areas=(0,0,0,0,0);focus-distances=0.10,1.20,Infinity;focus-mode=auto;focus-mode-values=auto,infinity,macro,continuous-video,continuous-picture;hdr-mode=0;horizontal-view-angle=64;hue=0;hue-max=2;hue-min=-2;imageuniqueid-value=0;intelligent-mode=-1;iso=auto;iso-values=auto,100,200,400,800;jpeg-quality=96;jpeg-thumbnail-height=384;jpeg-thumbnail-quality=100;jpeg-thumbnail-size-values=512x384,512x288,384x384,0x0;jpeg-thumbnail-width=512;max-exposure-compensation=20;max-num-detected-faces-hw=16;max-num-detected-faces-sw=0;max-num-focus-areas=1;max-num-metering-areas=0;max-zoom=30;maxaperture-value-denominator=100;maxaperture-value-numerator=185;metering=center;metering-areas=;metering-values=matrix,center,spot;min-exposure-compensation=-20;motion-speed=-1;odc=false;phase-af=on;phase-af-values=off,on;picture-format=jpeg;picture-format-values=jpeg;picture-size=4608x3456;picture-size-values=4608x3456,4608x2592,3456x3456,3264x2448,3264x1836,2448x2448,2048x1152,1920x1080,1280x720,960x720,640x480,320x240,256x144;preferred-preview-size-for-video=1920x1080;preview-format=yuv420sp;preview-format-values=yuv420sp,yuv420p;preview-fps-range=15000,30000;preview-fps-range-values=(15000,15000),(24000,24000),(15000,30000),(30000,30000);preview-frame-rate=30;preview-frame-rate-values=15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30;preview-size-values=1920x1080,1440x1080,1088x1088,1280x720,1056x704,1024x768,960x720,720x720,720x480,640x480,352x288,320x240,256x144,176x144;rotation=0;rt-hdr=off;rt-hdr-values=off;saturation=0;saturation-max=2;saturation-min=-2;scene-mode=auto;scene-mode-values=auto;sharpness=0;sharpness-max=2;sharpness-min=-2;shot-mode=0;smooth-zoom-supported=false;vertical-view-angle=39;video-frame-format=nv21;video-size=1920x1080;video-size-values=1920x1080,1440x1080,1072x1072,1280x720,960x720,800x450,720x480,640x480,480x320,352x288,320x240,176x144;video-snapshot-supported=true;video-stabilization-supported=false;vrmode=-1;vrmode-supported=true;wb-k=0;wdr=0;whitebalance=auto;whitebalance-values=auto,incandescent,fluorescent,daylight,cloudy-daylight;zoom=0;zoom-ratios=100,104,109,114,120,125,131,138,144,151,158,166,174,182,190,200,209,219,229,240,251,263,276,289,303,317,332,348,364,381,400;zoom-supported=true;preview-size=1920x1080
I/CenterCropStrategy(11983): Preview: 1920x1080; Scaled: 0x0; Want: 0x0
D/AndroidRuntime(11983): Shutting down VM
E/AndroidRuntime(11983): FATAL EXCEPTION: main
E/AndroidRuntime(11983): Process: com.adactive.walkstaff.dev, PID: 11983
E/AndroidRuntime(11983): java.lang.ArithmeticException: divide by zero
E/AndroidRuntime(11983): at com.journeyapps.barcodescanner.CameraPreview.calculateFrames(CameraPreview.java:389)
E/AndroidRuntime(11983): at com.journeyapps.barcodescanner.CameraPreview.previewSized(CameraPreview.java:461)
E/AndroidRuntime(11983): at com.journeyapps.barcodescanner.CameraPreview.access$300(CameraPreview.java:59)
E/AndroidRuntime(11983): at com.journeyapps.barcodescanner.CameraPreview$3.handleMessage(CameraPreview.java:199)
E/AndroidRuntime(11983): at android.os.Handler.dispatchMessage(Handler.java:101)
E/AndroidRuntime(11983): at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime(11983): at android.app.ActivityThread.main(ActivityThread.java:6944)
E/AndroidRuntime(11983): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11983): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
E/AndroidRuntime(11983): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Lost connection to device.
Can you add torch?
Could this package be adapted to support front camera scan?
QrCode library not working as expected in old version it's working fine. captureOutput not calling in current version
exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureSession addInput:] Can't add a nil AVCaptureInput'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e39f0e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50ad79b2 objc_exception_throw + 48
2 AVFoundation 0x00007fff20908783 -[AVCaptureSession addInput:] + 1058
3 qrcode 0x000000010f47eecc -[QRCaptureView initWithFrame:viewIdentifier:arguments:registrar:] + 1100
4 qrcode 0x000000010f47e785 -[QRCapturePlatformView initWithFrame:viewIdentifier:arguments:registrar:] + 261
5 qrcode 0x000000010f47fd11 -[QRCaptureViewFactory createWithFrame:viewIdentifier:arguments:] + 193
6 Flutter 0x000000010d27d2d1 _ZN7flutter30FlutterPlatformViewsController8OnCreateEP17FlutterMethodCallRU13block_pointerFvP11objc_objectE + 707
7 Flutter 0x000000010d278321 __47-[FlutterEngine maybeSetupPlatformViewChannels]_block_invoke.127 + 38
8 Flutter 0x000000010d2ffb35 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104
9 Flutter 0x000000010d293920 _ZNK7flutter21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 166
10 Flutter 0x000000010d2973ce _ZN7flutter15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 38
11 Flutter 0x000000010d2f96e9 _ZNSt3__110__function6__funcIZN7flutter5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrINS2_15PlatformMessageEEEE4$_32NS_9allocatorIS8_EEFvvEEclEv + 57
12 Flutter 0x000000010d2a68f3 _ZN3fml15MessageLoopImpl10FlushTasksENS_9FlushTypeE + 117
13 Flutter 0x000000010d2ab638 ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0 + 26
14 CoreFoundation 0x00007fff23d9e634 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
15 CoreFoundation 0x00007fff23d9e2ce __CFRunLoopDoTimer + 1038
16 CoreFoundation 0x00007fff23d9d92a __CFRunLoopDoTimers + 282
17 CoreFoundation 0x00007fff23d9857e __CFRunLoopRun + 1950
18 CoreFoundation 0x00007fff23d97ac4 CFRunLoopRunSpecific + 404
19 GraphicsServices 0x00007fff38b2fc1a GSEventRunModal + 139
20 UIKitCore 0x00007fff48bc7f80 UIApplicationMain + 1605
21 Runner 0x000000010cfe7a8b main + 75
22 libdyld.dylib 0x00007fff519521fd start + 1
23 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
QR code recognition is fast, but barcode recognition is very slow, and often cannot be recognized. both on Android and Ios.
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.