如何使用flutter访问android中的特定文件夹? [英] How do i access specific folders in android using flutter?

查看:610
本文介绍了如何使用flutter访问android中的特定文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有电影,ifont,歌曲,图像,whatsapp等文件夹

Say I have folders like movies, ifont, song, images, whatsapp, etc

在我的外部存储设备上,我想访问上述任何文件夹中的文件并使用flutter存储到列表。

On my External storage, I want to access files from any of the folders above and store to a list using flutter.

我已经向android.xml
添加了必要的权限,但是对于如何进一步发展,我一无所知,

感谢代码段。

I already added the necessary permissions to android.xml But I am clueless on how to go further from there,
I would appreciate a code snippet.

谢谢。

推荐答案

您可以使用 listSync 以获得子目录和文件的列表,您将获得 FileSystemEntity 。您还需要对外部存储进行权限管理,因此请使用插件

you can use listSync to get the list of sub-directories and files and you will get a list of FileSystemEntity.you also need to get persmmison to external storage so use this plugin

  • check out this Question also

这篇关于如何使用flutter访问android中的特定文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆