setBarcodeFormats method
Sets the barcode formats to be recognized.
The formats
parameter specifies the barcode types to detect.
Returns 0
on success, or an error code on failure.
Implementation
Future<int> setBarcodeFormats(int formats) async {
try {
dynamic rawSettings =
await handleThenable(_barcodeReader!.getSimplifiedSettings(""));
dynamic dartSettings = dartify(rawSettings);
Map obj = convertBigIntsToInts(dartSettings);
obj['barcodeSettings']['barcodeFormatIds'] = formats;
await handleThenable(_barcodeReader!.updateSettings("", jsify(obj)));
} catch (e) {
print(e);
return -1;
}
return 0;
}