简体   繁体   中英

App crashing on opening QR Scanner Flutter

I am using QR Scanner to scan a qr code but when I click on scan qr button the app is crashing. This is my code:

  Future scanQR() async {
    String barcode = await scanner.scan();
    setState(() => this.barcode = barcode);
    print(barcode);
  }

I am using this plugin for qr scanner:

https://pub.dev/packages/qrscan#-installing-tab-

I am not getting any errors in logs as well

您是否在 android 和 IOS 中添加了所需的权限?

通过使用不同的插件解决了这个问题

import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM