ContentDispositionHeader constructor Null safety

ContentDispositionHeader(
  1. String rawValue
)

Implementation

ContentDispositionHeader(String rawValue) : super(rawValue) {
  dispositionText = value;
  switch (dispositionText.toLowerCase()) {
    case 'inline':
      disposition = ContentDisposition.inline;
      break;
    case 'attachment':
      disposition = ContentDisposition.attachment;
      break;
    default:
      disposition = ContentDisposition.other;
      break;
  }

  filename = MailCodec.decodeHeader(parameters['filename']);
  creationDate = DateCodec.decodeDate(parameters['creation-date']);
  modificationDate = DateCodec.decodeDate(parameters['modification-date']);
  readDate = DateCodec.decodeDate(parameters['read-date']);
  final sizeText = parameters['size'];
  if (sizeText != null) {
    size = int.tryParse(sizeText);
  }
}