getContentType function

  1. @deprecated
String getContentType (
  1. String extension
)

Get the content type based on

Implementation

@deprecated
String getContentType(String extension) {
  final Map<String, dynamic> extensions = _queryExtensions();
  if (extension.lastIndexOf('.') >= 0) {
    extension = extension.substring(extension.lastIndexOf('.') + 1);
  }

  String contentType = extensions[extension.toLowerCase()];

  contentType ??= 'application/octet-stream';

  return contentType;
}