setMulticodeCachingDuration method

Future<void> setMulticodeCachingDuration(
  1. int multicodeCachingDuration
)

Sets the caching duration (in milliseconds) for multi-code results.

multicodeCachingDuration: An integer representing the multicode caching duration in milliseconds.

Example usage:

int cachingDuration = 5000; // 5 seconds
await _barkoder.setMulticodeCachingDuration(cachingDuration);
print('Multicode caching duration set to: $cachingDuration');

Implementation

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

  return _methodChannel.invokeMethod(
      'setMulticodeCachingDuration', multicodeCachingDuration);
}