type static method

Future<String> type(
  1. String path, {
  2. String defaultType = "",
})

Implementation

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