0

我在 Flutter 中使用阿拉伯名称从本地路径加载视频文件时遇到问题,例如:

/var/mobile/Containers/Data/Application/Local/Documents/بناء_مشروع_فلتر.mp4

有人可以帮我解决这个问题吗?

4

2 回答 2

0
///Decode the path to utf-8 string
var url = utf8.decode("/var/mobile/Containers/Data/Application/Local/Documents/بناء_مشروع_فلتر.mp4");
于 2021-06-09T21:48:15.117 回答
0

使用 Flutter 插件来查找文件系统上的常用位置。支持 iOS、Android、Linux 和 MacOS

Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;

Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;

请参阅此插件的示例应用程序以获取完整示例。

将路径存储在变量中后,您可以在该路径中附加文件名以访问文件系统中的任何文件

于 2021-06-09T20:58:07.140 回答