我正在 flutter 中构建一个文件储物柜应用程序,它可以锁定文件和文件夹。当用户解锁文件夹时,我希望我的应用程序显示一个在本机文件资源管理器中查看文件夹内容的选项。有什么办法可以实现这个功能吗?
(提前致谢..)
您可以针对您提到的用例尝试此包:打开文件 https://pub.dev/packages/open_file
Usage:
import 'package:open_file/open_file.dart';
import 'package:path_provider/path_provider.dart';
//Get the path to the directory
final String dir = (await getTemporaryDirectory()).path;
//Use the path to launch the directory with the native file explorer
await OpenFile.open('$dir\\');
(注:仅在Windows操作系统上测试)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)