Skip to content

A new flutter plugin for checking and requesting permissions on iOs and Android.

License

Notifications You must be signed in to change notification settings

kmccmk9/flutter_simple_permissions

 
 

Repository files navigation

Simple Permissions

A new flutter plugin for checking and requesting permissions on iOs and Android.

Getting Started

Make sure you add the needed permissions to your Android Manifest Permission and Info.plist.

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

API

List of currently available permissions

enum Permission {
  // Microphone
  RecordAudio,

  // Camera
  Camera,

  // External Storage
  WriteExternalStorage,

  // Access Coarse Location (Android) / When In Use iOs
  AccessCoarseLocation,

  // Access Fine Location (Android) / When In Use iOS
  AccessFineLocation,

  // Access Fine Location (Android) / When In Use iOS
  WhenInUseLocation,

  // Access Fine Location (Android) / Always Location iOS  
  AlwaysLocation
}
/// Permissions status enum (iOs)
enum PermissionStatus { notDetermined, restricted, denied, authorized }

Methods

  /// Check a [permission] and return a [Future] with the result
  static Future<bool> checkPermission(Permission permission);

  /// Request a [permission] and return a [Future] with the result
  static Future<bool> requestPermission(Permission permission);

  /// Open app settings on Android and iOs
  static Future<bool> openSettings();
  
  /// Get iOs permission status 
  static Future<PermissionStatus> getPermissionStatus(Permission permission)

About

A new flutter plugin for checking and requesting permissions on iOs and Android.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 34.6%
  • Dart 25.0%
  • Java 24.7%
  • Ruby 13.8%
  • Objective-C 1.9%