v0.0.2+1
cr_file_saver
允许在 Android 和 IOS 设备上保存文件,并在需要时请求权限。
34喜欢 8近 30 天下载150Pub 分数
AndroidiOS
Cleveroad/cr_file_saver open-source repository details.
以下为英文项目原文快照,最新内容请访问 GitHub。
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
cr_file_saver: ^0.0.2
If you are using android 9 and below add this permission to project manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Add permissions in ios folder, go to ios/Runner/info.plist and add next keys:
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
In your dart file add the following import:
import 'package:cr_file_saver/cr_file_saver.dart';
CRFileSaver has several static methods to work with:
requestWriteExternalStoragePermission to check for permission and ask it if needed.saveFile simply saving file with provided file path and desired file name.saveFileWithDialog save file through standard file saving dialog. Note that this method will throw NoResolvedActivityException if Android device has 30 api or higher依赖清单 5 项
{"sdk":"flutter"}^2.1.2{"sdk":"flutter"}^2.0.1^3.2.6先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗