setThresholdBetweenDuplicatesScans method

Future<void> setThresholdBetweenDuplicatesScans(
  1. int thresholdBetweenDuplicatesScans
)

Sets the threshold between duplicate scans.

thresholdBetweenDuplicatesScans: An integer representing the threshold in seconds between duplicate scans.

Example usage:

int threshold = 1; // 100 milliseconds
_barkoder.setThresholdBetweenDuplicatesScans(threshold);
print('Threshold between duplicate scans set to: $threshold milliseconds');

Implementation

Future<void> setThresholdBetweenDuplicatesScans(
    int thresholdBetweenDuplicatesScans) {
  if (_isBarkoderViewNotMounted) {
    return Future.error(PlatformException(
        code: BarkoderErrors.barkoderViewNotMounted,
        message: BarkoderErrors.barkodeViewNotMountedDesc));
  }

  return _methodChannel.invokeMethod(
      'setThresholdBetweenDuplicatesScans', thresholdBetweenDuplicatesScans);
}