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

套件詳情v2.1.0

open_file_manager

一個用於開啟預設檔案管理員應用程式的 Flutter 插件。在 Android 上,它會在檔案管理員應用中開啟下載/最近資料夾。在 iOS 上,它會在 Files 應用中開啟應用程式之文件資料夾。

AndroidiOS
近 30 天下載
1.5萬
喜歡數
39
Pub 分數
160

安裝套件

flutter pub add open_file_manager

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 插件,可開啟裝置的預設檔案管理員應用程式。在 Android 上,會導航至下載或最近資料夾;在 iOS 上,則會在 Files 應用中開啟應用程式的文件目錄。這讓使用者能輕鬆地在應用程式環境中存取與管理檔案,無需自訂檔案瀏覽介面。此外,該插件透過利用原生系統行為來簡化檔案導覽,確保跨平台的一致使用者體驗。

適用情境

  • 在檔案應用中開啟特定於應用的文件
  • 導航到最近或已下載的檔案
  • 從應用內啟用使用者檔案管理
  • 與檔案儲存工作流程整合
  • 提供對應用儲存目錄的快速存取

主要特色

  • 跨平台相容性(Android 與 iOS)
  • 使用最少的設定開啟預設檔案管理員
  • 直接導航至下載/最近或應用文件
  • 使用原生系統檔案瀏覽器
  • 透過 pub add 命令進行簡單整合

適合對象

  • 需要檔案訪問功能的應用
  • 檔案共享或文件管理應用
  • 生成或儲存本機檔案的應用程式
  • 尋求原生檔案瀏覽器整合的開發者
  • 專案需要最少的檔案UI複雜性

使用建議

  • 對特定資料夾選擇的控制有限
  • 依賴設備的預設檔案管理員
  • 不支援自訂檔案瀏覽 UI
  • 行為可能在不同裝置間略有差異
  • 不直接處理檔案建立或編輯

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Open File Manager

A Flutter plugin to open the default File Manager 📁 app.

Platform Support

Android iOS
SDK 21+ iOS 12+

Use of AndroidFolderType.other requires minimum SDK 26 in Android.

Features 🚀

  • Android:

    • Ability to open Recent, Downloads, and Other folders.
    • For the Other folder, you need to specify the folder path.
  • iOS:

    • Ability to open the app’s Documents folder and its subdirectories.

Please follow the iOS platform configuration ⬇️ before jump to the Dart code.

iOS Configuration

The iOS app can open the app’s Documents folder and its subdirectories if specified.

The plugin will open the Files app on iOS. To display your app’s Documents folder under On My iPhone, add the following code snippet to your Info.plist:

<key>UISupportsDocumentBrowser</key>  
<true/>

Additionally, you must save at least one file to your app’s Documents folder for it to appear in the Files app.

Code Implementation 👨‍💻

It's a super simple to implement. Just call the openFileManager method and add androidConfig for Android and iosConfig for iOS.

import 'package:open_file_manager/open_file_manager.dart';

openFileManager(
   androidConfig: AndroidConfig(
       folderType: AndroidFolderType.recent,
   ),
   iosConfig: IosConfig(
       // Path is case-sensitive here.
       folderPath: 'Reports/Sheets',
   ),
);
Default method without config:
import 'package:open_file_manager/open_file_manager.dart';

openFileManager();

If androidConfig is not provided, the Android app will open the Downloads folder by default.

If iosConfig is not provided, the iOS app will open the app's Documents folder by default.

Open Other folder on Android:

To open a specific folder on Android, you need to set folderType as AndroidFolderType.other and provide the folderPath in AndroidConfig:

import 'package:open_file_manager/open_file_manager.dart';

openFileManager(
    androidConfig: AndroidConfig(
        folderType: AndroidFolderType.other,
        folderPath: 'Pictures/Screenshots',
    ),
);

The folderPath supports the following path formats:

  • Pictures/Screenshots
  • /storage/emulated/0/Pictures/Screenshots
  • /storage/243F-4E12/Pictures/Screenshots

If folderPath does not exist, the Recent folder will be opened.

所屬分類

依賴

依賴清單 1 項

  • plugin_platform_interface^2.1.8

原始碼儲存庫

使用此套件的專案