On most operating systems, permissions aren't just granted to apps at install time.
On most operating systems, permissions aren't just granted to apps at install time.
Rather, developers have to ask the user for permissions while the app is running.
Rather, developers have to ask the user for permissions while the app is running.
...
@@ -137,12 +137,12 @@ You can remove permissions you don't use:
...
@@ -137,12 +137,12 @@ You can remove permissions you don't use:
## How to use
## How to use
There are a number of [`Permission`](https://pub.dev/documentation/permission_handler_platform_interface/latest/permission_handler_platform_interface/Permission-class.html#constants)s.
There are a number of [`Permission`](https://pub.dev/documentation/permission_handler_platform_interface/latest/permission_handler_platform_interface/Permission-class.html#constants)s.
You can get a `Permission`'s`status`,whichiseither`undetermined`,`granted`,`denied`,`restricted`or`permanentlyDenied`.
You can get a `Permission`'s`status`,whichiseither`granted`,`denied`,`restricted`or`permanentlyDenied`.
```dart
```dart
var status = await Permission.camera.status;
var status = await Permission.camera.status;
if (status.isUndetermined) {
if (status.denied) {
// We didn't ask for permission yet.
// We didn't ask for permission yet or the permission has been denied before but not permanently.
}
}
// You can can also directly ask the permission about its status.
// You can can also directly ask the permission about its status.
* Fixed deprecation warning when building Android project.
## 6.0.0
## 6.0.0
This release includes the following **breaking changes**:
* Migrated to null safety
* Migrated to null safety
* Removed PermissionStatus.undetermined, PermissionStatus.denied will be used instead (see our "[Changes in 6.0.0](https://github.com/Baseflow/flutter-permission-handler/wiki/Changes-in-6.0.0)" wiki page for more details).