我正在尝试使用 open file flutter 包打开一个文件,该文件存在但未打开。
我也没有收到任何错误。发布了一个片段。
var dir = await getExternalStorageDirectory();
File myFile = File('${dir.path}/$classCode/$fileName.$fileType');
if (myFile.existsSync()) {
print('file present');
}
print(myFile.toString());
myFile.exists().then((value) async {
print('hello');
return await OpenFile.open('${myFile.toString()}');
});
改变 return await OpenFile.open('${myFile.toString()}');
到 return await OpenFile.open('${myFile.path.toString()}');
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句