setThreadsLimit method

Future<void> setThreadsLimit(
  1. int threadsLimit
)

Sets the threads limit.

threadsLimit: The number of threads to set as the limit.

Example usage:

int threadsLimit = 2;
_barkoder.setThreadsLimit(threadsLimit);
print('Threads limit set to: $threadsLimit');

Implementation

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

  return _methodChannel.invokeMethod('setThreadsLimit', threadsLimit);
}