如何打开/查找由path_provider创建的文件? [英] How to open/find the file created by path_provider?

查看:60
本文介绍了如何打开/查找由path_provider创建的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是flutter和dart的初学者,并且在使用flutter处理文件时遇到了一些问题.

I'm a beginner at flutter and dart and had some issues with file handling using flutter.

我正在尝试为我的flutter应用程序将数据本地存储在文本文件中,并在flutter网站上遇到了使用path_provider和dart:io的标准教程.它有关于获取路径以及读取和写入文件的说明,但是对于我添加到项目中的文件来说,这似乎不起作用.存储到文件的唯一方法是先使用内置函数进行写入,然后读取此新创建的文件.我无法添加自己的文件并无法使用flutter读取文件.

I'm trying to store data locally in text files for my flutter application, and came across the standard tutorial on flutter's website which used path_provider and dart:io. It had instructions on getting the path and reading and writing to a file, however this didn't seem to work for files I added to the project. The only way to store to files was to first write using the inbuilt functions, then reading this newly created file. I can't add my own file and read it using flutter.

我也无法打开由flutter创建的文件,因为我不知道它的存储位置. getApplicationDocumentsDirectory()给出的路径返回路径/data/user/0/com.example.daily_challenges/app_flutter ,我不知道在哪里可以找到它我的项目.

I also can't open the file created by flutter as I don't know where its stored. The path given by getApplicationDocumentsDirectory() returns the path /data/user/0/com.example.daily_challenges/app_flutter, and I don't know where to find this in my project.

总结:如何读取现有文件以及如何查看由flutter自动创建的文件.

In summary: How do I read a pre-existing file and how do I view the file created automatically by flutter.

谢谢:)

推荐答案

您可以通过Android Studio中的设备文件资源管理器从物理设备或模拟器中访问文件.遵循本指南

You can access the files from a physical device or simulator through Device File Explorer in Android Studio. Follow this guide

这篇关于如何打开/查找由path_provider创建的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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