copyWith method
Returns a new ApiConfig with the provided fields replaced.
Any field left null keeps its current value.
Implementation
ApiConfig copyWith({
String? baseUrl,
String? apiVersion,
Duration? timeout,
Map<String, String>? defaultHeaders,
bool? needTenantByDefault,
}) {
return ApiConfig(
baseUrl: baseUrl ?? this.baseUrl,
apiVersion: apiVersion ?? this.apiVersion,
timeout: timeout ?? this.timeout,
defaultHeaders: defaultHeaders ?? this.defaultHeaders,
needTenantByDefault: needTenantByDefault ?? this.needTenantByDefault,
);
}