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

套件詳情v13.0.2

permission_handler

Flutter 的權限外掛。此外掛提供跨平台(iOS、Android)API,用於請求和檢查權限。

AndroidiOSWebWindows
近 30 天下載
393萬
喜歡數
6020
Pub 分數
160

安裝套件

flutter pub add permission_handler

套件介紹

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

permission_handler 套件為 Flutter 應用程式提供了一個跨平台 API,可在 Android、iOS、Web 和 Windows 上請求和檢查裝置權限。它透過一致且與平台無關的方法,簡化了對相機、麥克風、位置和儲存空間存取等敏感使用者權限的處理。此外,該套件確保在不同作業系統上實現安全可靠的權限管理,減少重複程式碼並提升開發者體驗。它能與 Flutter 生態系統無縫整合,支援執行時權限請求與狀態檢查。

適用情境

  • 在照片應用中請求相機訪問權限
  • 在使用GPS功能之前檢查位置權限
  • 管理檔案上傳的儲存存取
  • 處理語音錄製應用中的麥克風權限
  • 確保符合隱私法規

主要特色

  • 跨平台支援(Android、iOS、Web、Windows)
  • 用於請求和檢查權限的簡單 API
  • 支援執行時權限處理
  • 返回詳細的權限狀態
  • 與Flutter工作流程整合良好

適合對象

  • 需要設備硬體存取權限的應用程式
  • 注重隱私的應用程式
  • 跨平台 Flutter 項目
  • 尋求一致權限處理的開發者
  • 需要符合平台特定權限政策的項目

使用建議

  • 需要在平台特定的檔案中進行正確配置(例如,Info.plist、AndroidManifest.xml)
  • 可能需要使用者互動以授予權限
  • 不會自動處理所有邊緣情況
  • 限於標準系統權限
  • 取決於對 async/await 模式的正確使用

原始 README

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

Flutter permission_handler plugin

The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation of the federated plugin concept can be found in the Flutter documentation. This means the permission_handler plugin is separated into the following packages:

  1. permission_handler: the app facing package. This is the package users depend on to use the plugin in their project. For details on how to use the permission_handler plugin you can refer to its README.md file. At this moment the Android and iOS platform implementations are also part of this package. Additional platform support will be added in their own individual "platform package(s)".
  2. permission_handler_platform_interface: this packages declares the interface which all platform packages must implement to support the app-facing package. Instructions on how to implement a platform packages can be found in the README.md of the permission_handler_platform_interface package.

所屬分類

依賴

依賴清單 6 項

  • meta^1.7.0
  • permission_handler_android^14.1.0
  • permission_handler_apple^9.5.0
  • permission_handler_html^0.1.4+0
  • permission_handler_platform_interface^4.4.0
  • permission_handler_windows^0.2.2

原始碼儲存庫

使用此套件的專案

所在榜單