multipart method

MethodWithBody multipart(
  1. Map<String, dynamic> values
)

Implementation

MethodWithBody multipart(Map<String, dynamic> values) {
  if (_body is! Map<String, Multipart>) {
    _body = <String, Multipart>{};
  }

  for (String field in values.keys) {
    dynamic value = values[field];
    if (value is List<int>) {
      multipartFile(field, value);
    } else if (value is Multipart) {
      _body[field] = value;
    } else {
      multipartField(field, value);
    }
  }

  return this;
}