Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/105.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 颤振:如何使用颤振获取扫描条形码的格式?_Android_Ios_Flutter_Qr Code_Barcode - Fatal编程技术网

Android 颤振:如何使用颤振获取扫描条形码的格式?

Android 颤振:如何使用颤振获取扫描条形码的格式?,android,ios,flutter,qr-code,barcode,Android,Ios,Flutter,Qr Code,Barcode,我正试图建立一个条形码扫描应用程序,使用相机扫描条形码,我设法在Flitter中找到了一些条形码插件,但它们似乎都以字符串形式返回结果,而且没有一个插件也能检测条形码的格式,有没有办法解决这个问题 更新:pubspec.yaml name: qr_code_scanner description: QR code scanner that can be embedded inside flutter. It uses zxing in Android and MTBBarcode scanner

我正试图建立一个条形码扫描应用程序,使用相机扫描条形码,我设法在Flitter中找到了一些条形码插件,但它们似乎都以字符串形式返回结果,而且没有一个插件也能检测条形码的格式,有没有办法解决这个问题

更新:pubspec.yaml

name: qr_code_scanner
description: QR code scanner that can be embedded inside flutter. It uses zxing in Android and MTBBarcode scanner in iOS.
version: 0.0.12
author: Julius Canute <juliuscanute at touchcapture.net>
homepage: https://juliuscanute.com
repository: https://github.com/juliuscanute/qr_code_scanner

environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

flutter:
  plugin:
    androidPackage: net.touchcapture.qr.flutterqr
    pluginClass: FlutterQrPlugin
名称:二维码扫描仪
描述:二维码扫描仪,可嵌入内部颤振。它在Android中使用zxing,在iOS中使用MTBBarcode扫描仪。
版本:0.0.12
作者:朱利叶斯·克努特
主页:https://juliuscanute.com
存储库:https://github.com/juliuscanute/qr_code_scanner
环境:

sdk:“>=2.0.0-dev.68.0对于任何面临相同问题的人,我可以通过更改该库提供的kotlin代码来解决此问题,而不是返回条形码/二维码编号,我添加了扫描代码的类型:

private fun createBarCodeView(): BarcodeView? {
 val barcode = BarcodeView(registrar.activity())
 barcode.decodeContinuous(
 object : BarcodeCallback {
    override fun barcodeResult(result: BarcodeResult) {
      var output = result.text + "____"+result?.barcodeFormat.toString() // <== this did the trick
  channel.invokeMethod("onRecognizeQR", output)
                    }
  override fun possibleResultPoints(resultPoints: List<ResultPoint>) {}
                }
        )
        return barcode
    }
private fun createBarCodeView():BarcodeView{
val条形码=条形码视图(registrator.activity())
条码解码(
对象:BarcodeCallback{
覆盖有趣的条形码结果(结果:条形码结果){

var输出=result.text+“\u__”+result?.barcodeFormat.toString()//您必须更具体地说明您尝试使用的软件包、您尝试扫描的条形码类型以及您获得的结果类型。在大多数情况下,扫描条形码时,字符串是您的全部。我使用的软件包调用程序是:flatterqrplugin:my pubspec.yaml
repository:https://github.com/juliuscanute/qr_code_scanner
环境:sdk:“>=2.0.0-dev.68.0,谢谢您提供更多信息。现在还不清楚您试图“绕开”的是什么。为什么将结果作为字符串不适用于您?使用此库,我只获得结果(条形码编号)而不是扫描条形码的类型,例如EAN13,我希望我的输出如下:条形码编号:86924557689192类型:EAN13