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

套件詳情v0.2.0

storage_path

一個用於獲取影像、音訊、影片和檔案路徑的 Flutter 外掛。

近 30 天下載
397
喜歡數
53
Pub 分數
40

安裝套件

flutter pub add storage_path

套件介紹

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

storage_path 套件是一個 Flutter 插件,專為簡化在 Android 與 iOS 裝置上取得影像、音訊、影片及其他檔案路徑而設計。它提供直覺的 API,可存取應用程式之文件、快取及外部儲存位置等常見儲存目錄。此實用工具協助開發者管理檔案儲存,無需處理平台特定的路徑邏輯。該套件輕巧且專注於路徑解析,非常適合處理媒體或檔案作業之應用程式。

適用情境

  • 訪問應用文件目錄
  • 獲取媒體文件路徑
  • 管理快取檔案
  • 儲存使用者產生的內容
  • 處理檔案上傳
  • 使用外部儲存

主要特色

  • 跨平台路徑解析
  • 簡單直覺的 API
  • 支援圖片、音訊、影片與一般檔案
  • 無額外依賴
  • 輕量且快速
  • 跨平台檔案路徑存取

適合對象

  • 媒體密集型應用
  • 檔案管理工具
  • 需要本機儲存的應用程式
  • 開發者原型
  • 處理使用者上傳檔案的應用程式

使用建議

  • 不處理檔案操作(例如讀/寫)
  • 僅限路徑檢索
  • 某些平台需要手動處理權限
  • 缺少目錄時沒有內建的錯誤處理
  • 不適合複雜的檔案系統操作

原始 README

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

StoragePath

A flutter plugin to get all images, audios, videos and files location path in json format.

Only for Android. If you like this plugin, buy me a cup of coffee. PayPal

dependencies:
 storage_path: ^0.2.1
import 'package:storage_path/storage_path.dart';

Sample Code

 try {
      imagePath = await StoragePath.imagesPath; //contains images path and folder name in json format
    } on PlatformException {
      imagesPath = 'Failed to get path';
    }

AND

videoPath = await StoragePath.videoPath; //this will return videos path
audioPath = await StoragePath.audioPath; //this will return audios path
filePath = await StoragePath.filePath; //this will return files path

Image Json Sample


[
 {
   "files": [
     "path/screenshot/abc.png",
     "path/screenshot/pqr.png"
   ],
   "folderName": "screenshot"
 }
]

File Json Sample

[
  {
    "files": [
      {
        "mimeType": "application/pdf",
        "size": "34113",
        "title": "C001-SP-2719^201902",
        "path": "/storage/emulated/0/Download/abc.pdf"
      }
    ],
    "folderName": "Download"
  }
]

Audio Json Sample

[
  {
    "files": [
      {
        "album": "ABC",
        "artist": "PQR",
        "path": "/storage/emulated/0/Download/todo.mp3",
        "dateAdded": "1515060080",
        "displayName": "todo.mp3",
        "duration": "235986",
        "size": "9506989"
      }
    ],
    "folderName": "Download"
  }
]

Video Json Sample

[
  {
    "files": [
      {
        "path": "/storage/emulated/0/DCIM/Camera/VID_20190304_112455.mp4",
        "dateAdded": "1551678904",
        "displayName": "VID_20190304_112455.mp4",
        "duration": "7147",
        "size": "12787914"
      }
    ],
    "folderName": "Camera"
  }
]

Thank you for contribution

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。