在 Dart 中,想检查目录是否存在但不知道该目录的子字符串:
例如:
目录=预览/1552146038702.jpg.1--001--001.html.test.jpg
我试过 :
io.Directory(await dir).exists().then((exist){
Run Code Online (Sandbox Code Playgroud)
但在目录中我不知道1--001--001.html
任何的想法?
Gün*_*uer 10
Directory.exists()
提供这些信息
bool exists = await Directory(path).exists();
这对我有用,希望我的回答有帮助
final path = '/storage/emulated/0/Download';
final checkPathExistence = await Directory(path).exists();
Run Code Online (Sandbox Code Playgroud)