如何使用flutter访问android中的特定文件夹?

编程入门 行业动态 更新时间:2024-10-28 02:33:24
本文介绍了如何使用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中的特定文件夹?

本文发布于:2023-10-31 16:49:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546691.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   文件夹   flutter   android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!