addBytes method Null safety

void addBytes(
  1. String name,
  2. List<int> bytes,
  3. {String? contentType,
  4. String? filename}
)

Add a field name to the form data.

contents will be added directly to the body, skipping encoding.

Implementation

void addBytes(String name, List<int> bytes,
    {String? contentType, String? filename}) {
  _isDirty = true;
  _entries.add(
    Entry.file(encoding.encode(name), bytes,
        contentType:
            contentType == null ? null : encoding.encode(contentType),
        filename: filename == null ? null : encoding.encode(filename)),
  );
}