yushulx / flutter_barcode_sdk

Build barcode QR detection apps for Windows, Linux, macOS, Android, iOS and web.
https://pub.dev/packages/flutter_barcode_sdk
MIT License
47 stars 18 forks source link

Hello. I got error on iphone device it is causing because of setBarcodeFormats method. #31

Closed umairali435 closed 1 year ago

umairali435 commented 2 years ago

I am passing data to it like: await _barcodeReader.setBarcodeFormats(BarcodeFormat.ALL); Unhandled Exception: type 'Null' is not a subtype of type 'FutureOr'

0 FlutterBarcodeSdk.setBarcodeFormats (package:flutter_barcode_sdk/flutter_barcode_sdk.dart:74:12)

yushulx commented 2 years ago

@umairali435 have you tried the example https://github.com/yushulx/flutter_barcode_sdk/blob/main/example/lib/mobile.dart?

Future<void> initBarcodeSDK() async {
    _barcodeReader = FlutterBarcodeSdk();
    // Get 30-day FREEE trial license from https://www.dynamsoft.com/customer/license/trialLicense?product=dbr
    await _barcodeReader.setLicense(
        'DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==');
    await _barcodeReader.init();
    await _barcodeReader.setBarcodeFormats(BarcodeFormat.ALL);
  }