setLicense method

Future<int> setLicense(
  1. String license
)

Sets the license key for the barcode reader.

The license parameter should be a valid license string obtained from Dynamsoft. Returns 0 on success, -1 on failure.

Implementation

Future<int> setLicense(String license) async {
  try {
    await LicenseManager.initLicense(license, true).toDart;
    await CoreModule.loadWasm(['dbr'.toJS].toJS).toDart;
  } catch (e) {
    print(e);
    return -1;
  }
  return 0;
}