首页 > 解决方案 > Flutter - getApplicationDocumentsDirectory() : 如何在 android 和 iOS 中获取路径

问题描述

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

在android本机代码中,我使用getCacheDir()

我如何getApplicationDocumentsDirectory()在android中获取路径?当我在 android 中打印getFilesDir()时,它不匹配getApplicationDocumentsDirectory()

请告诉我 android 和 iOS 中的等价物。

谢谢

标签: javaandroidiosswiftflutter

解决方案


推荐阅读