添加新的覆盖物以进行颤动条形码扫描(barcode_scan)

时间:2019-09-03 02:05:04

标签: flutter barcode-scanner

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

1 个答案:

答案 0 :(得分:0)

请尝试使用此软件包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(),
      );
    }

演示图片

enter image description here