ShadertoyHttpOptions constructor

ShadertoyHttpOptions({
  1. String? baseUrl,
  2. required bool supportsCookies,
  3. int? poolMaxAllocatedResources,
  4. int? poolTimeout,
  5. int? retryMaxAttempts,
  6. int? shaderCount,
  7. ErrorMode? errorHandling,
})

Builds a ShadertoyHttpOptions

Implementation

ShadertoyHttpOptions(
    {String? baseUrl,
    required this.supportsCookies,
    int? poolMaxAllocatedResources,
    int? poolTimeout,
    int? retryMaxAttempts,
    int? shaderCount,
    ErrorMode? errorHandling})
    : baseUrl = baseUrl ?? defaultBaseUrl,
      poolMaxAllocatedResources =
          poolMaxAllocatedResources ?? defaultPoolMaxAllocatedResources,
      poolTimeout = poolTimeout ?? defaultPoolTimeout,
      retryMaxAttempts = retryMaxAttempts ?? defaultRetryMaxAttempts,
      shaderCount = shaderCount ?? defaultShaderCount,
      super(errorHandling: errorHandling) {
  assert(this.baseUrl.isNotEmpty, 'baseUrl is empty');
  assert(this.poolMaxAllocatedResources >= 1,
      'poolMaxAllocatedResources is greater or equal to one');
  assert(this.poolTimeout >= 0, 'poolTimeout is greater or equal to zero');
  assert(this.retryMaxAttempts >= 0,
      'retryMaxAttempts is greater or equal to zero');
  assert(
      this.shaderCount > 0, 'shaderCount should be greater or equal to zero');
}