MultipartFormDataUpload constructor
MultipartFormDataUpload({})
Default constructor which requires either files or data to be set.
Implementation
MultipartFormDataUpload({
required String url,
UploadMethod method = UploadMethod.POST,
Map<String, String>? headers,
String? tag,
this.files,
this.data,
bool allowCellular = true,
}) : assert(files != null || data != null),
super(
url: url,
method: method,
headers: headers,
tag: tag,
allowCellular: allowCellular,
) {
// Need to specify either files or data.
assert(files!.isNotEmpty || data!.isNotEmpty);
}