简体   繁体   English

错误:无法以声音空安全运行,因为以下依赖项(flutter_absolute_path)

[英]Error: Cannot run with sound null safety, because the following dependencies (flutter_absolute_path)

Does the flutter_absolute_path v1.0.6 dependency not support null safety? flutter_absolute_path v1.0.6 依赖项不支持空安全吗? Is there any other solution to get absolute path of a file?有没有其他解决方案来获取文件的绝对路径?

for (int i = 0; i < resultList.length; i++) {
   var path = await 
   FlutterAbsolutePath.getAbsolutePath(resultList[i].identifier);
   print(path + '**path**');
   f.add(File(path));
}

Try this plugin file_picker file_picker: ^3.0.3试试这个插件 file_picker file_picker: ^3.0.3

//use this line to pick files
FilePickerResult? result = await FilePicker.platform.pickFiles();


//use this to process what file is returned
 if(result != null) {
   File file = File(result.files.single.path);
} else {
   // User canceled the picker
}

You can read about extra features here: https://pub.dev/packages/file_picker您可以在此处阅读有关额外功能的信息: https : //pub.dev/packages/file_picker

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全; 在 flutter - Error: Cannot run with sound null safety, because the following dependencies don't support null safety; in flutter Flutter 不能以空安全运行,因为以下依赖不支持空安全 - Flutter Cannot run with sound null safety, because the following dependencies don't support null safety 错误:无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全: - Error: Cannot run with sound null safety, because the following dependencies don't support null safety: 无法正常运行 null 安全,因为以下依赖项 [build\windows\flutter\flutter_assemble.vcxproj] - Cannot run with sound null safety, because the following dependencies [build\windows\flutter\flutter_assemble.vcxproj] 无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全 - Cannot run with sound null safety, because the following dependencies don't support null safety "无法以可靠的 null 安全性运行,因为以下依赖项不支持 null 安全性:" - Cannot run with sound null safety, because the following dependencies don't support null safety: 无法以声音 null 安全运行,因为依赖项不支持 null 安全 - Cannot run with sound null safety because dependencies doesnot support null safety 无法以声音 null 安全运行,因为依赖项不支持 null 安全 - Cannot run with sound null safety because dependencies don't support null safety 无法正常运行 null 安全,Flutter - Cannot run with sound null safety, Flutter 火焰错误:无法运行声音 null 安全 - Flame Error: Cannot run with sound null safety
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM