Commit 6b494eac by Maurits van Beusekom

Update readme file

parent e0e18e25
......@@ -31,7 +31,7 @@ dependencies:
### Requesting permission
``` dart
```dart
import 'package:permission_handler/permission_handler.dart';
Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler().requestPermissions([PermissionGroup.contacts]);
......@@ -39,7 +39,7 @@ Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler().r
### Checking permission
``` dart
```dart
import 'package:permission_handler/permission_handler.dart';
PermissionStatus permission = await PermissionHandler().checkPermissionStatus(PermissionGroup.contacts);
......@@ -47,7 +47,7 @@ PermissionStatus permission = await PermissionHandler().checkPermissionStatus(Pe
### Checking service status
``` dart
```dart
import 'package:permission_handler/permission_handler.dart';
ServiceStatus serviceStatus = await PermissionHandler().checkServiceStatus(PermissionGroup.location);
......@@ -57,7 +57,7 @@ Checking the service status only makes sense for the `PermissionGroup.location`
### Open app settings
``` dart
```dart
import 'package:permission_handler/permission_handler.dart';
bool isOpened = await PermissionHandler().openAppSettings();
......@@ -65,7 +65,7 @@ bool isOpened = await PermissionHandler().openAppSettings();
### Show a rationale for requesting permission (Android only)
``` dart
```dart
import 'package:permission_handler/permission_handler.dart';
bool isShown = await PermissionHandler().shouldShowRequestPermissionRationale(PermissionGroup.contacts);
......@@ -77,7 +77,7 @@ This will always return `false` on iOS.
Defines the permission groups for which permissions can be checked or requested.
``` dart
```dart
enum PermissionGroup {
/// The unknown permission only used for return type, never requested
unknown,
......@@ -148,7 +148,7 @@ enum PermissionGroup {
Defines the state of a permission group
``` dart
```dart
enum PermissionStatus {
/// Permission to access the requested feature is denied by the user.
denied,
......@@ -167,6 +167,27 @@ enum PermissionStatus {
}
```
### Overview of possible service statuses
Defines the state of the backing service for the supplied permission group
```dart
/// Defines the state of a service related to the permission group
enum ServiceStatus {
/// The unknown service status indicates the state of the service could not be determined.
unknown,
/// There is no service for the supplied permission group.
notApplicable,
/// The service for the supplied permission group is disabled.
disabled,
/// The service for the supplied permission group is enabled.
enabled
}
```
## Issues
Please file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/BaseflowIT/flutter-permission-handler/issues) page.
......
......@@ -23,7 +23,7 @@ enum ServiceStatus {
/// The unknown service status indicates the state of the service could not be determined.
unknown,
/// There is not separate service for the supplied permission group.
/// There is no service for the supplied permission group.
notApplicable,
/// The service for the supplied permission group is disabled.
......
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