getfiletypeIcon static method

dynamic getfiletypeIcon(
  1. String? type, {
  2. String? path,
})

Implementation

static getfiletypeIcon(String? type, {String? path}) {
  if (type == null && path != null) {
    type = path.split(".").last;
  }
  switch (type) {
    case "pdf":
      return pdf;
    case "png":
    case "jpg":
    case "jpeg":
      return image;
    case "epub":
      return epub;
    case "mp3":
      return audio;
    case "mp4":
    case "flv":
      return audio;
    case "docx":
    case "xls":
      return doc;
    case "link":
      return link;
    case "doc":
      return doc;
    default:
      return doc;
  }
}