Skip to content

Commit fb752f4

Browse files
authored
Merge pull request Baseflow#460 from Baseflow/remove_undetermined
Removed PermissionStatus.undetermined
2 parents f557526 + 4d6addb commit fb752f4

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

permission_handler_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0.0+1
2+
3+
* **BREAKING**: Removed PermissionStatus.undetermined. This is now replaced by PermissionStatus.denied.
4+
15
## 3.0.0
26

37
* Migrated to null safety.

permission_handler_platform_interface/lib/src/permission_status.dart

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ part of permission_handler_platform_interface;
22

33
/// Defines the state of a [Permission].
44
enum PermissionStatus {
5-
/// The permission wasn't requested yet.
6-
undetermined,
7-
85
/// The user granted access to the requested feature.
96
granted,
107

@@ -37,7 +34,7 @@ extension PermissionStatusValue on PermissionStatus {
3734
return 1;
3835
case PermissionStatus.restricted:
3936
return 2;
40-
case PermissionStatus.undetermined:
37+
case PermissionStatus.denied:
4138
return 3;
4239
case PermissionStatus.permanentlyDenied:
4340
return 5;
@@ -53,17 +50,13 @@ extension PermissionStatusValue on PermissionStatus {
5350
PermissionStatus.denied,
5451
PermissionStatus.granted,
5552
PermissionStatus.restricted,
56-
PermissionStatus.undetermined,
5753
PermissionStatus.limited,
5854
PermissionStatus.permanentlyDenied,
5955
][value];
6056
}
6157
}
6258

6359
extension PermissionStatusGetters on PermissionStatus {
64-
/// If the permission was never requested before.
65-
bool get isUndetermined => this == PermissionStatus.undetermined;
66-
6760
/// If the user granted access to the requested feature.
6861
bool get isGranted => this == PermissionStatus.granted;
6962

@@ -86,9 +79,6 @@ extension PermissionStatusGetters on PermissionStatus {
8679
}
8780

8881
extension FuturePermissionStatusGetters on Future<PermissionStatus> {
89-
/// If the permission was never requested before.
90-
Future<bool> get isUndetermined async => (await this).isUndetermined;
91-
9282
/// If the user granted access to the requested feature.
9383
Future<bool> get isGranted async => (await this).isGranted;
9484

permission_handler_platform_interface/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: A common platform interface for the permission_handler plugin.
33
homepage: https://github.com/baseflow/flutter-permission-handler/tree/master/permission_handler_platform_interface
44
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
55
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
6-
version: 3.0.0
6+
version: 3.0.0+1
77

88
dependencies:
99
flutter:

0 commit comments

Comments
 (0)