ContentDispositionHeader.from constructor

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

Convenience method to create a Content-Disposition header with the given disposition.

Implementation

ContentDispositionHeader.from(
  this.disposition, {
  this.filename,
  this.creationDate,
  this.modificationDate,
  this.readDate,
  this.size,
}) : super(disposition == ContentDisposition.inline
          ? 'inline'
          : disposition == ContentDisposition.attachment
              ? 'attachment'
              : 'unsupported') {
  dispositionText = disposition.name;
}