패키지, 저장소 및 앱 카테고리 검색

패키지 상세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를 원활하게 래핑합니다
  • 안드로이드 및 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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.