已开启
change:修复闪光灯开启/关闭不生效的bug #57
change:修复闪光灯开启/关闭不生效的bug #57
已开启
travel创建于 1月29日
1 个文件变更+5-1
@@ -145,7 +145,7 @@ export class MobileScannerPlugin implements FlutterPlugin, MethodCallHandler, Ab
145 });145 });
146 } else if (call.method === "start") {146 } else if (call.method === "start") {
147 this.start(call, result)147 this.start(call, result)
148- } else if (call.method === "torch") {148+ } else if (call.method === "torch"|| call.method === "toggleTorch") {
149 this.toggleTorch(call, result)149 this.toggleTorch(call, result)
150 } else if (call.method === "stop") {150 } else if (call.method === "stop") {
151 this.stop(result)151 this.stop(result)
@@ -206,6 +206,10 @@ export class MobileScannerPlugin implements FlutterPlugin, MethodCallHandler, Ab
206 "torchable": hasFlashUnit(this.applicationContext!),206 "torchable": hasFlashUnit(this.applicationContext!),
207 "numberOfCameras": 1207 "numberOfCameras": 1
208 });208 });
209+ this.eventSink?.success( {
210+ name: 'torchState',
211+ data: this.torch ? TorchState.on : TorchState.off
212+ })
209 }213 }
210 214 
211 // 重启相机流215 // 重启相机流