contentTypeByFilename function

String contentTypeByFilename(
  1. String filename
)

Implementation

String contentTypeByFilename(String filename) {
  final seqs = filename.split('.');
  if (seqs.length == 1) {
    return "application/octet-stream";
  }
  final ext = seqs[seqs.length - 1];
  return _EXTRA_TYPES_MAP['.$ext'];
}