DownloadPool constructor

DownloadPool({
  1. int poolSize = MAX_POOL_SIZE,
})

Constructs a DownloadPool with the specified poolSize. Throws an ArgumentError if the pool size is less than or equal to zero.

Implementation

DownloadPool({int poolSize = MAX_POOL_SIZE}) : _poolSize = poolSize {
  if (_poolSize <= 0) {
    throw ArgumentError('Pool size must be greater than 0');
  }
  _client = Dio()..httpClientAdapter = NativeAdapter();
  _streamController = StreamController.broadcast();
}