merge method
- {String method,
- String baseUrl,
- Map<
String, dynamic> queryParameters, - String path,
- int connectTimeout,
- int receiveTimeout,
- int sendTimeout,
- Map<
String, dynamic> extra, - Map<
String, dynamic> headers, - ResponseType responseType,
- String contentType,
- ValidateStatus validateStatus,
- bool receiveDataWhenStatusError,
- bool followRedirects,
- int maxRedirects,
- RequestEncoder requestEncoder,
- ResponseDecoder responseDecoder}
Create a Option from current instance with merging attributes.
Implementation
BaseOptions merge({
String method,
String baseUrl,
Map<String, dynamic> queryParameters,
String path,
int connectTimeout,
int receiveTimeout,
int sendTimeout,
Map<String, dynamic> extra,
Map<String, dynamic> headers,
ResponseType responseType,
String contentType,
ValidateStatus validateStatus,
bool receiveDataWhenStatusError,
bool followRedirects,
int maxRedirects,
RequestEncoder requestEncoder,
ResponseDecoder responseDecoder,
}) {
return BaseOptions(
method: method ?? this.method,
baseUrl: baseUrl ?? this.baseUrl,
queryParameters: queryParameters ?? this.queryParameters,
connectTimeout: connectTimeout ?? this.connectTimeout,
receiveTimeout: receiveTimeout ?? this.receiveTimeout,
sendTimeout: sendTimeout ?? this.sendTimeout,
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,
responseDecoder: responseDecoder ?? this.responseDecoder,
);
}