static String getDirNameByFile(File? file) { if (file == null) return ""; return getDirName(file.absolute.path); }