merge method

  1. @override
RequestOptions merge({
  1. String? method,
  2. int? sendTimeout,
  3. int? receiveTimeout,
  4. int? connectTimeout,
  5. String? data,
  6. String? path,
  7. Map<String, dynamic>? queryParameters,
  8. String? baseUrl,
  9. ProgressCallback? onReceiveProgress,
  10. ProgressCallback? onSendProgress,
  11. CancelToken? cancelToken,
  12. Map<String, dynamic>? extra,
  13. Map<String, dynamic>? headers,
  14. ResponseType? responseType,
  15. String? contentType,
  16. ValidateStatus? validateStatus,
  17. bool? receiveDataWhenStatusError,
  18. bool? followRedirects,
  19. int? maxRedirects,
  20. RequestEncoder? requestEncoder,
  21. ResponseDecoder? responseDecoder,
  22. CollectionFormat? collectionFormat,
})
override

Create a Option from current instance with merging attributes.

Implementation

@override
RequestOptions merge({
  String? method,
  int? sendTimeout,
  int? receiveTimeout,
  int? connectTimeout,
  String? data,
  String? path,
  Map<String, dynamic>? queryParameters,
  String? baseUrl,
  ProgressCallback? onReceiveProgress,
  ProgressCallback? onSendProgress,
  CancelToken? cancelToken,
  Map<String, dynamic>? extra,
  Map<String, dynamic>? headers,
  ResponseType? responseType,
  String? contentType,
  ValidateStatus? validateStatus,
  bool? receiveDataWhenStatusError,
  bool? followRedirects,
  int? maxRedirects,
  RequestEncoder? requestEncoder,
  ResponseDecoder? responseDecoder,
  CollectionFormat? collectionFormat,
}) {
  return RequestOptions(
      method: method ?? this.method,
      sendTimeout: sendTimeout ?? this.sendTimeout,
      receiveTimeout: receiveTimeout ?? this.receiveTimeout,
      connectTimeout: connectTimeout ?? this.connectTimeout,
      data: data ?? this.data,
      path: path ?? this.path,
      queryParameters: queryParameters ?? this.queryParameters,
      baseUrl: baseUrl ?? this.baseUrl,
      onReceiveProgress: onReceiveProgress ?? this.onReceiveProgress,
      onSendProgress: onSendProgress ?? this.onSendProgress,
      cancelToken: cancelToken ?? this.cancelToken,
      extra: extra ?? Map.from(this.extra),
      headers: headers ?? Map.from(this.headers),
      responseType: responseType ?? this.responseType,
      contentType: contentType ?? this.contentType,
      validateStatus: validateStatus ?? this.validateStatus,
      receiveDataWhenStatusError:
          receiveDataWhenStatusError ?? this.receiveDataWhenStatusError,
      followRedirects: followRedirects ?? this.followRedirects,
      maxRedirects: maxRedirects ?? this.maxRedirects,
      requestEncoder: requestEncoder ?? this.requestEncoder,
      responseDecoder: responseDecoder ?? this.responseDecoder,
      collectionFormat: collectionFormat ?? this.collectionFormat);
}