Permission class

Defines the permissions which can be checked and requested.

Available extensions
Annotations
  • @immutable

Constructors

Permission.byValue(int value)
Creates a Permission using the supplied integer value.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
isDenied Future<bool>

Available on Permission, provided by the PermissionCheckShortcuts extension

If the user denied this permission.
no setter
isGranted Future<bool>

Available on Permission, provided by the PermissionCheckShortcuts extension

If the user granted this permission.
no setter
isLimited Future<bool>

Available on Permission, provided by the PermissionCheckShortcuts extension

User has authorized this application for limited photo library access. Only supported on iOS.(iOS14+)
no setter
isPermanentlyDenied Future<bool>

Available on Permission, provided by the PermissionCheckShortcuts extension

Returns true when permissions are denied permanently.
no setter
isProvisional Future<bool>

Available on Permission, provided by the PermissionCheckShortcuts extension

If the application is provisionally authorized to post noninterruptive user notifications. Only supported on iOS.
no setter
isRestricted Future<bool>

Available on Permission, provided by the PermissionCheckShortcuts extension

If the OS denied this permission. The user cannot change the status, possibly due to active restrictions such as parental controls being in place. Only supported on iOS.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldShowRequestRationale Future<bool>

Available on Permission, provided by the PermissionActions extension

If you should show a rationale for requesting permission.
no setter
status Future<PermissionStatus>

Available on Permission, provided by the PermissionActions extension

Checks the current status of the given Permission.
no setter
value int
Integer representation of the Permission.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDeniedCallback(FutureOr<void>? callback()?) Permission

Available on Permission, provided by the PermissionActions extension

Method to set a callback for when permission is denied.
onGrantedCallback(FutureOr<void>? callback()?) Permission

Available on Permission, provided by the PermissionActions extension

Method to set a callback for when permission is granted.
onLimitedCallback(FutureOr<void>? callback()?) Permission

Available on Permission, provided by the PermissionActions extension

Method to set a callback for when permission is limited.
onPermanentlyDeniedCallback(FutureOr<void>? callback()?) Permission

Available on Permission, provided by the PermissionActions extension

Method to set a callback for when permission is permanently denied.
onProvisionalCallback(FutureOr<void>? callback()?) Permission

Available on Permission, provided by the PermissionActions extension

Method to set a callback for when permission is provisional.
onRestrictedCallback(FutureOr<void>? callback()?) Permission

Available on Permission, provided by the PermissionActions extension

Method to set a callback for when permission is restricted.
request() Future<PermissionStatus>

Available on Permission, provided by the PermissionActions extension

Request the user for access to this Permission, if access hasn't already been grant access before.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

accessMediaLocation → const Permission
Permission for accessing the device's media library.
accessNotificationPolicy → const Permission
Permission for accessing the device's notification policy.
activityRecognition → const Permission
Permission for accessing the activity recognition.
appTrackingTransparency → const Permission
Permission for accessing the device's tracking state (iOS only).
assistant → const Permission
Android: Nothing iOS: SiriKit
audio → const Permission
Permission for accessing the device's audio files from external storage.
backgroundRefresh → const Permission
Permission for reading the current background refresh status. (iOS only)
bluetooth → const PermissionWithService
Permission for accessing the device's bluetooth adapter state.
bluetoothAdvertise → const Permission
Permission for advertising Bluetooth devices
bluetoothConnect → const Permission
Permission for connecting to Bluetooth devices.
bluetoothScan → const Permission
Permission for scanning for Bluetooth devices.
calendar → const Permission
Permission for accessing the device's calendar.
calendarFullAccess → const Permission
Permission for reading from and writing to the device's calendar.
calendarWriteOnly → const Permission
Permission for writing to the device's calendar.
camera → const Permission
Permission for accessing the device's camera.
contacts → const Permission
Permission for accessing the device's contacts.
criticalAlerts → const Permission
Permission for sending critical alerts (iOS only).
ignoreBatteryOptimizations → const Permission
Permission for accessing ignore battery optimizations (Android only).
location → const PermissionWithService
Permission for accessing the device's location.
locationAlways → const PermissionWithService
Permission for accessing the device's location when the app is running in the background.
locationWhenInUse → const PermissionWithService
Permission for accessing the device's location when the app is running in the foreground.
manageExternalStorage → const Permission
Permission for accessing the device's external storage.
mediaLibrary → const Permission
Permission for accessing the device's media library (iOS 9.3+ only).
microphone → const Permission
Permission for accessing the device's microphone.
nearbyWifiDevices → const Permission
Permission for connecting to nearby devices via Wi-Fi.
notification → const Permission
Permission for pushing notifications.
phone → const PermissionWithService
Permission for accessing the device's phone state (Android only).
photos → const Permission
Permission for accessing the device's photos.
photosAddOnly → const Permission
Permission for adding photos to the device's photo library (iOS only).
reminders → const Permission
Permission for accessing the device's reminders (iOS only).
requestInstallPackages → const Permission
Permission for requesting installing packages.
scheduleExactAlarm → const Permission
Permission for scheduling exact alarms.
sensors → const Permission
Permission for accessing the device's sensors.
sensorsAlways → const Permission
Permission for accessing the device's sensors in background.
sms → const Permission
Permission for sending and reading SMS messages (Android only).
speech → const Permission
Permission for accessing speech recognition.
storage → const Permission
Permission for accessing external storage.
systemAlertWindow → const Permission
Permission for creating system alert window (Android only).
unknown → const Permission
The unknown only used for return type, never requested.
values → const List<Permission>
Returns a list of all possible PermissionGroup values.
videos → const Permission
Permission for accessing the device's video files from external storage.