addMimeType function

void addMimeType(
  1. String extension,
  2. String mimeType
)

Adds additonal mime type for the given extension. Note: it overrides the system default if any.

Example:

addMimeType("woff2", "application/font-woff2");

Implementation

void addMimeType(String extension, String mimeType) {
  assert(!extension.startsWith('.'));
  assert(mimeType.isNotEmpty);
  _mimeResolver.addExtension(extension, mimeType);
}