gpt4 book ai didi

android - 在 Flutter 中,如何在原生文件资源管理器中为用户打开一个文件夹,以便用户浏览其文件/文件夹

转载 作者:行者123 更新时间:2023-12-04 23:39:56 25 4
gpt4 key购买 nike

我正在 flutter 中构建一个文件储物柜应用程序,它可以锁定文件和文件夹。当用户解锁文件夹时,我希望我的应用程序显示查看文件夹内容的选项,但在 native 文件资源管理器中。有没有办法实现这个功能?
(提前致谢..)

最佳答案

您可以针对您提到的用例尝试此包:open_file
用法:

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 操作系统上测试)

关于android - 在 Flutter 中,如何在原生文件资源管理器中为用户打开一个文件夹,以便用户浏览其文件/文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64982099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com