【发布时间】:2020-12-08 07:52:08
【问题描述】:
我正在开发一个 Flutter 移动应用程序并尝试解决 Web 中对 Path Provider 的支持不足的问题。
我正在使用 PDF (pdf: ^1.9.0) 包生成 PDF 文档并将其上传到 Google 云端硬盘,我正在尝试确定是否可以生成 PDF 并将其存储在内存中以制作它网络兼容。
使用路径提供程序的当前代码示例。
createFile() async {
final downloads = await getApplicationSupportDirectory();
final file = File("${downloads.path}/$filename.pdf");
await file.writeAsBytes(pdf.save());
await GoogleDriveController.uploadFileToGoogleDrive(file.path);
}
问题:有没有办法使用 Flutter web 为 web 生成 Fies 并将其存储在内存中?
【问题讨论】:
-
不,你不能在内存中存储
Files -
@pskink 感谢您的确认,看来我必须将其卸载到 GCP 功能。