Commit fb752f41 by Maurits van Beusekom Committed by GitHub

Merge pull request #460 from Baseflow/remove_undetermined

Removed PermissionStatus.undetermined
parents f557526b 4d6addbe
## 3.0.0+1
* **BREAKING**: Removed PermissionStatus.undetermined. This is now replaced by PermissionStatus.denied.
## 3.0.0 ## 3.0.0
* Migrated to null safety. * Migrated to null safety.
......
...@@ -2,9 +2,6 @@ part of permission_handler_platform_interface; ...@@ -2,9 +2,6 @@ part of permission_handler_platform_interface;
/// Defines the state of a [Permission]. /// Defines the state of a [Permission].
enum PermissionStatus { enum PermissionStatus {
/// The permission wasn't requested yet.
undetermined,
/// The user granted access to the requested feature. /// The user granted access to the requested feature.
granted, granted,
...@@ -37,7 +34,7 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -37,7 +34,7 @@ extension PermissionStatusValue on PermissionStatus {
return 1; return 1;
case PermissionStatus.restricted: case PermissionStatus.restricted:
return 2; return 2;
case PermissionStatus.undetermined: case PermissionStatus.denied:
return 3; return 3;
case PermissionStatus.permanentlyDenied: case PermissionStatus.permanentlyDenied:
return 5; return 5;
...@@ -53,7 +50,6 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -53,7 +50,6 @@ extension PermissionStatusValue on PermissionStatus {
PermissionStatus.denied, PermissionStatus.denied,
PermissionStatus.granted, PermissionStatus.granted,
PermissionStatus.restricted, PermissionStatus.restricted,
PermissionStatus.undetermined,
PermissionStatus.limited, PermissionStatus.limited,
PermissionStatus.permanentlyDenied, PermissionStatus.permanentlyDenied,
][value]; ][value];
...@@ -61,9 +57,6 @@ extension PermissionStatusValue on PermissionStatus { ...@@ -61,9 +57,6 @@ extension PermissionStatusValue on PermissionStatus {
} }
extension PermissionStatusGetters on PermissionStatus { extension PermissionStatusGetters on PermissionStatus {
/// If the permission was never requested before.
bool get isUndetermined => this == PermissionStatus.undetermined;
/// If the user granted access to the requested feature. /// If the user granted access to the requested feature.
bool get isGranted => this == PermissionStatus.granted; bool get isGranted => this == PermissionStatus.granted;
...@@ -86,9 +79,6 @@ extension PermissionStatusGetters on PermissionStatus { ...@@ -86,9 +79,6 @@ extension PermissionStatusGetters on PermissionStatus {
} }
extension FuturePermissionStatusGetters on Future<PermissionStatus> { extension FuturePermissionStatusGetters on Future<PermissionStatus> {
/// If the permission was never requested before.
Future<bool> get isUndetermined async => (await this).isUndetermined;
/// If the user granted access to the requested feature. /// If the user granted access to the requested feature.
Future<bool> get isGranted async => (await this).isGranted; Future<bool> get isGranted async => (await this).isGranted;
......
...@@ -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: 3.0.0 version: 3.0.0+1
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