arcticfox1919 / flutter-scankit

Flutter QR code scanning
MIT License
142 stars 46 forks source link

使用一段时间发现2个会偶现的BUG #47

Closed peakandyuri closed 1 year ago

peakandyuri commented 1 year ago

试了一段时间,遇到两个偶现的BUG,出现频率未知,但一定会出现。 我这里主要是用来扫条码。 BUG1:识别结果错误,结果与条码数据差异很大,看起来就是每位数字都不一样的那种。 BUG2:连续响应结果,明明只扫码了一次,但是结果却触发了两次

ScanKitWidget(
    callback: (controller) {
      _controller = controller;
      controller.onResult.listen((result) {
        DateTime dtNow = DateTime.now();
        if (dtNow.difference(dt).inMilliseconds < 1000) {
          debugPrint(result);
          //偶现的连续触发,忽略其结果
          return;
        }
        dt = dtNow;
        Get.back(result: result);
      });
    },
    continuouslyScan: false,
    boundingBox: rect),

第二个BUG我可以暂时使用上面的方式来规避,但第一个却没有办法规避。

在pub上试了两款扫码插件,scankit识别率高,识别速度快,但启动速度不是最快的,我每次扫码从弹出相机到得到扫码结果耗费的时间在2.5秒左右,如果可能还是希望能提升下启动速度。

zwczou commented 1 year ago

第一个估计是识别准确率问题,我用mobile scanner,发现条码基本上100次识别对一次,微信可以对个90多次

peakandyuri commented 1 year ago

第一个估计是识别准确率问题,我用mobile scanner,发现条码基本上100次识别对一次,微信可以对个90多次

mobile scanner我也试了,距离远了错误率极高,近一些还好,但是也会出现错误结果

zwczou commented 1 year ago

我是识别条形码,打印在机器后面的,特别有些打印效果不好,基本上完全没法用,用这个感觉基本上达到我想要的效果了。

而且mobile scanner还存在一个问题,flutter build apk --target-platform android-arm64没有效果了,仍然把x86,arm都打包进来了。

danyunLu commented 1 year ago

第二个问题我也出现了,最后发现是因为_controller.dispose()方法没有生效

peakandyuri commented 1 year ago

我用这个库在mac上打ios的包遇到一些问题,已经换成fl_mlkit_scanning了,整体识别效果感觉差不多