mimetype static method
Implementation
static Future<String> mimetype(String path, {String defaultType = ""}) async {
String type;
try {
if (!_mimeLibraryLoaded) {
await mime.loadLibrary();
_mimeLibraryLoaded = true;
}
type = mime.lookupMimeType(path) ?? defaultType;
} catch (e) {
type = defaultType;
}
return type;
}