copyWith method

DfHttpClientConfig copyWith({
  1. String? baseApiUrl,
  2. Encoding? encoding,
  3. Map<String, String>? headers,
  4. int? timeout,
  5. bool? retryApiCall,
  6. bool? waitForTokenRefresh,
  7. int? maxRetryAttempts,
  8. Future<Result<String, Exception>> refreshToken()?,
})

Implementation

DfHttpClientConfig copyWith({
  String? baseApiUrl,
  Encoding? encoding,
  Map<String, String>? headers,
  int? timeout,
  bool? retryApiCall,
  bool? waitForTokenRefresh,
  int? maxRetryAttempts,
  Future<Result<String, Exception>> Function()? refreshToken,
}) {
  return DfHttpClientConfig(
    baseApiUrl: baseApiUrl ?? this.baseApiUrl,
    encoding: encoding ?? this.encoding,
    headers: headers ?? {...this.headers},
    maxRetryAttempts: maxRetryAttempts ?? this.maxRetryAttempts,
    refreshToken: refreshToken ?? this.refreshToken,
    retryApiCall: retryApiCall ?? this.retryApiCall,
    timeout: timeout ?? this.timeout,
    waitForTokenRefresh: waitForTokenRefresh ?? this.waitForTokenRefresh,
  );
}