【问题标题】:Add new over lay for flutter bar code scan (barcode_scan)为颤振条码扫描添加新的覆盖(barcode_scan)
【发布时间】:2019-09-03 02:05:04
【问题描述】:

在我的应用程序中,我必须添加 qr 扫描仪,并且我使用 barcode_scan 包开发了它,没有任何问题。但我需要更改扫描覆盖页。我仍然找不到编辑或添加新扫描覆盖的方法。有没有人这样做过,任何线索将不胜感激?

【问题讨论】:

  • 您能更详细地解释您的问题吗?我不确定“扫描覆盖页”的实际含义。有什么方法可以包含代码示例?我使用 qr_mobile_vision 包,它在没有 if 语句的情况下在 Android 和 IOS 上都能完美运行。也许你可以考虑一下。

标签: flutter barcode-scanner


【解决方案1】:

请试试这个包https://pub.dev/packages/last_qr_scanner

这个包使用 AndroidView 和 UiKitView

class _QRViewState extends State<LastQrScannerPreview> {
  @override
  Widget build(BuildContext context) {
    var androidView = AndroidView(
      viewType: 'last_qr_scanner/qrview',
      onPlatformViewCreated: _onPlatformViewCreated,
    );

    if (defaultTargetPlatform == TargetPlatform.android) {
      return androidView;
    }

    if (defaultTargetPlatform == TargetPlatform.iOS) {
      return UiKitView(
        viewType: 'last_qr_scanner/qrview',
        onPlatformViewCreated: _onPlatformViewCreated,
        creationParams: _CreationParams.fromWidget(0, 0).toMap(),
        creationParamsCodec: StandardMessageCodec(),
      );
    }

演示图片

【讨论】:

    猜你喜欢
    • 2022-11-08
    • 2020-08-23
    • 1970-01-01
    • 2020-04-18
    • 2021-10-23
    • 2021-04-16
    • 1970-01-01
    • 2019-01-04
    • 1970-01-01
    相关资源
    最近更新 更多