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

套件詳情v0.0.14

permission_config

一個 Flutter CLI 外掛,可自動新增 Android/iOS 權限並產生權限處理邏輯。

AndroidiOS
近 30 天下載
30
喜歡數
37
Pub 分數
150

安裝套件

flutter pub add permission_config

套件介紹

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

一個 Flutter CLI 插件,可自動新增 Android 與 iOS 權限,並產生對應的權限處理程式碼。它透過減少手動設定來簡化應用開發,確保在平台特定的清單檔案中正確宣告權限,並產生請求與檢查權限的範本程式碼。非常適合希望縮短設定時間並避免應用部署時常見權限相關錯誤的開發者。

適用情境

  • 為新Flutter專案自動設定權限
  • 減少 AndroidManifest.xml 和 Info.plist 中的手動設定
  • 為執行時檢查生成權限請求邏輯
  • 透過一致的權限處理加速應用開發
  • 確保符合平台特定的權限要求

主要特色

  • CLI 驅動的權限設定
  • 權限處理程式碼的自動生成
  • 同時支援 Android 和 iOS 平台
  • 與現有 Flutter 專案整合
  • 所需人工干預最少

適合對象

  • Flutter 初學者學習權限管理
  • 旨在跨項目標準化權限設置的團隊
  • 需要多個權限的應用程式開發者
  • 對移動權限有嚴格合規需求的專案
  • 快速原型設計與安全權限處理

使用建議

  • 需要熟悉 Flutter CLI
  • 可能需要在自動生成後進行客製化
  • 本身不是執行時權限管理器
  • 依賴外部 permission_handler 套件
  • 在專案開發初期使用效果最佳

原始 README

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

🚀 Permission Config

A Flutter CLI plugin that automatically adds Android/iOS permissions (Camera, Microphone, Location) to your Flutter project and generates a ready-to-use runtime permission handler file.
Say goodbye to manually editing AndroidManifest.xml and Info.plist — this tool does it all for you!


✨ Features

  • ✅ ✅ Supports permissions for Camera, Microphone, Location, Storage, Bluetooth, Sensors, Contacts, Calendar, Photos, Notifications, and Speech Recognition
  • ⚙️ Automatically injects required Android and iOS permission entries
  • 📁 Generates a pre-written permission_handler.dart file under lib/Utils/
  • 📦 Adds permission_handler dependency automatically in your pubspec.yaml
  • 💾 Creates backup files (.bak) before modifying platform configs
  • 📝 Uses logger for clean, informative CLI output

📦 Installation

Activate the plugin globally with Dart pub:

dart pub global activate permission_config

🔧 Usage

Run this command inside your Flutter project root:

permission_config <permission> [optional-ios-message]
Supported permissions:
Permission Aliases Description
camera - Access to the device camera
microphone mic Access to the microphone
location - Access to device location services (fine & coarse)
storage - Read/write external storage (Android only)
bluetooth - Access Bluetooth and BLE devices
sensors - Access body sensors and motion data
contacts - Access the user's contact list
calendar - Access calendar events and reminders
photos - Access the photo library (iOS only)
notifications - Access to send and display notifications (iOS only)
speech - Use speech recognition services (iOS only)
all - Adds all supported permissions above automatically
Examples:
permission_config all
permission_config camera
permission_config mic "This app needs mic access for voice chat."
permission_config location

💾 Backup Files

Before applying changes, backups are created:

  • AndroidManifest.xml.bak
  • Info.plist.bak

🙌 Contribution

Found a bug or want to add more permissions?
Feel free to open an issue or submit a pull request! Your contributions are welcome. 💙


👤 Contributors

所屬分類

依賴

依賴清單 3 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。