パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.0.0+1

permission_asker

permission_handler のラッパーで、アプリケーション内の権限処理に必要なボイラープレートコードの一部を軽減します。

AndroidiOS
30日間ダウンロード
4
いいね数
19
Pub ポイント
130

パッケージをインストール

flutter pub add permission_asker

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Permission_Asker は、permission_handler ライブラリをラップすることで、権限の処理を簡素化する Flutter パッケージです。Android および iOS アプリで権限を要求および管理するために必要なボイラープレートコードを削減し、より洗練された、より簡潔な API を提供します。パッケージは一般的な権限ワークフローをスムーズにし、繰り返しコードなしで権限ステータスの確認、要求、応答が容易になります。デバイスの権限を扱う際のコードの読みやすさと保守性を向上させる軽量なソリューションを探している開発者に最適です。

用途

  • 写真アプリでカメラアクセスをリクエストする
  • ナビゲーションアプリでの場所の権限の取り扱い
  • ファイルアップロードのストレージアクセスの管理
  • 録音前にマイクの権限を確認する
  • 複数の画面にまたがる権限チェックを簡素化する

主な機能

  • 明確なAPIでボイラープレートを削減
  • permission_handler をスムーズにラップします
  • Android および iOS プラットフォームをサポートしています
  • 簡単な権限ステータスの確認を提供
  • 直感的なリクエストメソッドを提供

適している対象

  • permission_handler を使用する開発者
  • 頻繁な権限管理を必要とするアプリ
  • クリーンで読みやすいコードを重視するチーム
  • 繰り返しの権限ロジックを最小限に抑えるプロジェクト
  • Flutter初心者が権限の扱いを学んでいる

注意事項

  • permission_handler を依存関係として必要とします
  • 基本的な権限操作に限定
  • 組み込みのUIカスタマイズなし
  • 複雑な権限フローを処理しない
  • 下位の permission_handler の動作に依存します

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

permission_asker

A wrapper for permission_handler which lifts some of the boilerplate needed to handle permissions in our apps.

Why

Usually, when we need to build our widgets according to the permission status of a certain feature we need to check if the permission is granted or not and ask for it. Since these are async operations we usually need to add some boilerplate to do the right thing at the right time.

What

In addition to everything that's provided with permission_handler by exposing it, this package provides:

  • a PermissionAsker class which allows to ask permissions and react to the results via the onPermissionData callback.
  • a PermissionAskerBuilderclass which allows to build a widget according to the status of a list of permissions

Setup

Check here for setting up your permissions.

Usage

Here's an example on how you can use the PermissionAskerBuilder widget

PermissionAskerBuilder(
  permissions: [
      Permission.location,
      Permission.camera,
  ],
  grantedBuilder: (context) => Center(
      child: Text('All permissions granted!'),
  ),
  notGrantedBuilder: (context, notGrantedPermissions) => Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
            Text('Not granted permissions:'),
            for (final p in notGrantedPermissions) 
              Text(p.toString())
        ],
      ),
  ),
  notGrantedListener: (notGrantedPermissions) => print('Not granted:\n$notGrantedPermissions'),
)

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。