from static method

ContentDispositionHeader from(
  1. ContentDisposition disposition, {
  2. String? filename,
  3. DateTime? creationDate,
  4. DateTime? modificationDate,
  5. DateTime? readDate,
  6. int? size,
})

Implementation

static ContentDispositionHeader from(ContentDisposition disposition,
    {String? filename,
    DateTime? creationDate,
    DateTime? modificationDate,
    DateTime? readDate,
    int? size}) {
  final rawValue;
  switch (disposition) {
    case ContentDisposition.inline:
      rawValue = 'inline';
      break;
    case ContentDisposition.attachment:
      rawValue = 'attachment';
      break;
    default:
      rawValue = 'unsupported';
      break;
  }
  final header = ContentDispositionHeader(rawValue);
  header.filename = filename;
  header.creationDate = creationDate;
  header.modificationDate = modificationDate;
  header.readDate = readDate;
  header.size = size;
  return header;
}