copyWith method
Creates a new instance of MultipartRequest based of on this
. It copies
all the properties and overrides the ones sent via parameters.
Implementation
MultipartRequest copyWith({
HttpMethod? method,
Uri? url,
Map<String, String>? headers,
Map<String, String>? fields,
List<MultipartFile>? files,
bool? followRedirects,
int? maxRedirects,
bool? persistentConnection,
}) =>
MultipartRequest(
method?.asString ?? this.method,
url ?? this.url,
)
..headers.addAll(headers ?? this.headers)
..fields.addAll(fields ?? this.fields)
..files.addAll(files ?? this.files)
..followRedirects = followRedirects ?? this.followRedirects
..maxRedirects = maxRedirects ?? this.maxRedirects
..persistentConnection =
persistentConnection ?? this.persistentConnection;