搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫Cleveroad/cr_file_saver

cr_file_saver

Cleveroad/cr_file_saver open-source repository details.

cr_file_saver 專案封面
星標
3
分支
11
最近推送(UTC)
2024年2月21日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

cr_file_saver

Header image

Cleveroad introduces file saver for Flutter

Features:
  • Request WriteExternalStoragePermission for Android if needed.
  • Save file to downloads directory on Android or Document folder on IOS.
  • Save file through standard file saving dialog.
Future features:
  • Saving file to a specific directory.

Setup

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  cr_file_saver: ^0.0.2
Android:

If you are using android 9 and below add this permission to project manifest:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
iOS:

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';

Usage

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
Cleveroad GitHub avatar
GitHub 作者

Cleveroad ↗

Professional web and mobile development company. Full-cycle IT development!

語言KotlinDartJavaObjective-CSwiftRubyShell

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.1.2
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^2.0.1
  • pigeon開發依賴^3.2.6

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗