📅  最后修改于: 2022-03-11 14:48:05.596000             🧑  作者: Mango
String path = 'your/path';
bool directoryExists = await Directory(path).exists();
bool fileExists = await File(path).exists();
if(directoryExists || fileExists) {
// do stuff
}