@@ -2,8 +2,8 @@ part of permission_handler_platform_interface;
2
2
3
3
/// Defines the state of a [Permission] .
4
4
enum PermissionStatus {
5
- /// The user denied access to the requested feature,
6
- /// permission needs to be asked first.
5
+ /// The user denied access to the requested feature, permission needs to be
6
+ /// asked first.
7
7
denied,
8
8
9
9
/// The user granted access to the requested feature.
@@ -12,19 +12,31 @@ enum PermissionStatus {
12
12
/// The OS denied access to the requested feature. The user cannot change
13
13
/// this app's status, possibly due to active restrictions such as parental
14
14
/// controls being in place.
15
+ ///
15
16
/// *Only supported on iOS.*
16
17
restricted,
17
18
18
- ///User has authorized this application for limited access.
19
+ /// The user has authorized this application for limited access. So far this
20
+ /// is only relevant for the Photo Library picker.
21
+ ///
19
22
/// *Only supported on iOS (iOS14+).*
20
23
limited,
21
24
22
25
/// Permission to the requested feature is permanently denied, the permission
23
26
/// dialog will not be shown when requesting this permission. The user may
24
27
/// still change the permission status in the settings.
28
+ ///
29
+ /// *On Android:*
30
+ /// Android 11+ (API 30+): whether the user denied the permission for a second
31
+ /// time.
32
+ /// Below Android 11 (API 30): whether the user denied access to the requested
33
+ /// feature and selected to never again show a request.
34
+ ///
35
+ /// *On iOS:*
36
+ /// If the user has denied access to the requested feature.
25
37
permanentlyDenied,
26
38
27
- /// The application is provisionally authorized to post noninterruptive user
39
+ /// The application is provisionally authorized to post non-interruptive user
28
40
/// notifications.
29
41
///
30
42
/// *Only supported on iOS (iOS12+).*
@@ -68,8 +80,7 @@ extension PermissionStatusValue on PermissionStatus {
68
80
69
81
/// Utility getter extensions for the [PermissionStatus] type.
70
82
extension PermissionStatusGetters on PermissionStatus {
71
- /// If the user denied access to the requested feature,
72
- /// permission needs to be asked first.
83
+ /// If the user denied access to the requested feature.
73
84
bool get isDenied => this == PermissionStatus .denied;
74
85
75
86
/// If the user granted access to the requested feature.
@@ -78,9 +89,14 @@ extension PermissionStatusGetters on PermissionStatus {
78
89
/// If the OS denied access to the requested feature. The user cannot change
79
90
/// this app's status, possibly due to active restrictions such as parental
80
91
/// controls being in place.
92
+ ///
81
93
/// *Only supported on iOS.*
82
94
bool get isRestricted => this == PermissionStatus .restricted;
83
95
96
+ /// If the permission to the requested feature is permanently denied, the
97
+ /// permission dialog will not be shown when requesting this permission. The
98
+ /// user may still change the permission status in the settings.
99
+ ///
84
100
/// *On Android:*
85
101
/// Android 11+ (API 30+): whether the user denied the permission for a second
86
102
/// time.
@@ -90,17 +106,18 @@ extension PermissionStatusGetters on PermissionStatus {
90
106
///
91
107
/// *On iOS:*
92
108
/// If the user has denied access to the requested feature.
93
- /// The user may still change the permission status in the settings
94
- ///
95
- /// WARNING: This can only be determined AFTER requesting this permission.
96
- /// Therefore make a `request` call first.
97
109
bool get isPermanentlyDenied => this == PermissionStatus .permanentlyDenied;
98
110
99
- /// Indicates that permission for limited use of the resource is granted.
111
+ /// If the user has authorized this application for limited access. So far
112
+ /// this is only relevant for the Photo Library picker.
113
+ ///
114
+ /// *Only supported on iOS (iOS14+).*
100
115
bool get isLimited => this == PermissionStatus .limited;
101
116
102
- /// If the application is provisionally authorized to post noninterruptive
117
+ /// If the application is provisionally authorized to post non-interruptive
103
118
/// user notifications.
119
+ ///
120
+ /// *Only supported on iOS (iOS12+).*
104
121
bool get isProvisional => this == PermissionStatus .provisional;
105
122
}
106
123
@@ -119,25 +136,30 @@ extension FuturePermissionStatusGetters on Future<PermissionStatus> {
119
136
/// *Only supported on iOS.*
120
137
Future <bool > get isRestricted async => (await this ).isRestricted;
121
138
139
+ /// If the permission to the requested feature is permanently denied, the
140
+ /// permission dialog will not be shown when requesting this permission. The
141
+ /// user may still change the permission status in the settings.
142
+ ///
122
143
/// *On Android:*
123
144
/// Android 11+ (API 30+): whether the user denied the permission for a second
124
145
/// time.
125
146
/// Below Android 11 (API 30): whether the user denied access to the requested
126
147
/// feature and selected to never again show a request.
127
- /// The user may still change the permission status in the settings.
128
148
///
129
149
/// *On iOS:*
130
150
/// If the user has denied access to the requested feature.
131
- /// The user may still change the permission status in the settings
132
151
Future <bool > get isPermanentlyDenied async =>
133
152
(await this ).isPermanentlyDenied;
134
153
135
- /// Indicates that permission for limited use of the resource is granted.
154
+ /// If the user has authorized this application for limited access. So far
155
+ /// this is only relevant for the Photo Library picker.
156
+ ///
157
+ /// *Only supported on iOS (iOS14+).*
136
158
Future <bool > get isLimited async => (await this ).isLimited;
137
159
138
- /// If the application is provisionally authorized to post noninterruptive
160
+ /// If the application is provisionally authorized to post non-interruptive
139
161
/// user notifications.
140
162
///
141
- /// *Only supported on iOS.*
163
+ /// *Only supported on iOS (iOS12+) .*
142
164
Future <bool > get isProvisional async => (await this ).isProvisional;
143
165
}
0 commit comments