Commit e38836b2 by Mathias Cochet

Permission status added.

parent 8d1aa526
...@@ -63,7 +63,7 @@ final class PermissionConstants { ...@@ -63,7 +63,7 @@ final class PermissionConstants {
static final int PERMISSION_STATUS_GRANTED = 1; static final int PERMISSION_STATUS_GRANTED = 1;
static final int PERMISSION_STATUS_RESTRICTED = 2; static final int PERMISSION_STATUS_RESTRICTED = 2;
static final int PERMISSION_STATUS_NOT_DETERMINED = 3; static final int PERMISSION_STATUS_NOT_DETERMINED = 3;
static final int PERMISSION_STATUS_NEVER_ASK_AGAIN = 4; static final int PERMISSION_STATUS_NEVER_ASK_AGAIN = 5;
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef({ @IntDef({
......
...@@ -17,15 +17,15 @@ enum PermissionStatus { ...@@ -17,15 +17,15 @@ enum PermissionStatus {
/// *Only supported on iOS.* /// *Only supported on iOS.*
restricted, restricted,
///User has authorized this application for limited access.
/// *Only supported on iOS (iOS14+).*
limited,
/// The user denied access to the requested feature and selected to never /// The user denied access to the requested feature and selected to never
/// again show a request for this permission. The user may still change the /// again show a request for this permission. The user may still change the
/// permission status in the settings. /// permission status in the settings.
/// *Only supported on Android.* /// *Only supported on Android.*
permanentlyDenied, permanentlyDenied,
///User has authorized this application for limited access.
/// *Only supported on iOS (iOS14+).*
limited,
} }
extension PermissionStatusValue on PermissionStatus { extension PermissionStatusValue on PermissionStatus {
...@@ -40,9 +40,9 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -40,9 +40,9 @@ extension PermissionStatusValue on PermissionStatus {
case PermissionStatus.undetermined: case PermissionStatus.undetermined:
return 3; return 3;
case PermissionStatus.permanentlyDenied: case PermissionStatus.permanentlyDenied:
return 4;
case PermissionStatus.limited:
return 5; return 5;
case PermissionStatus.limited:
return 4;
default: default:
throw UnimplementedError(); throw UnimplementedError();
} }
...@@ -54,8 +54,8 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -54,8 +54,8 @@ extension PermissionStatusValue on PermissionStatus {
PermissionStatus.granted, PermissionStatus.granted,
PermissionStatus.restricted, PermissionStatus.restricted,
PermissionStatus.undetermined, PermissionStatus.undetermined,
PermissionStatus.permanentlyDenied,
PermissionStatus.limited, PermissionStatus.limited,
PermissionStatus.permanentlyDenied,
][value]; ][value];
} }
} }
......
...@@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin. ...@@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin.
homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a # NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.0.1 version: 2.0.2
dependencies: dependencies:
flutter: flutter:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment