Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
permission_handler
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
permission_handler
Commits
6b494eac
Commit
6b494eac
authored
Feb 12, 2019
by
Maurits van Beusekom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update readme file
parent
e0e18e25
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
README.md
+28
-7
lib/permission_enums.dart
+1
-1
No files found.
README.md
View file @
6b494eac
...
@@ -31,7 +31,7 @@ dependencies:
...
@@ -31,7 +31,7 @@ dependencies:
### Requesting permission
### Requesting permission
```
dart
```
dart
import
'package:permission_handler/permission_handler.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
Map
<
PermissionGroup
,
PermissionStatus
>
permissions
=
await
PermissionHandler
().
requestPermissions
([
PermissionGroup
.
contacts
]);
Map
<
PermissionGroup
,
PermissionStatus
>
permissions
=
await
PermissionHandler
().
requestPermissions
([
PermissionGroup
.
contacts
]);
...
@@ -39,7 +39,7 @@ Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler().r
...
@@ -39,7 +39,7 @@ Map<PermissionGroup, PermissionStatus> permissions = await PermissionHandler().r
### Checking permission
### Checking permission
```
dart
```
dart
import
'package:permission_handler/permission_handler.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
PermissionStatus
permission
=
await
PermissionHandler
().
checkPermissionStatus
(
PermissionGroup
.
contacts
);
PermissionStatus
permission
=
await
PermissionHandler
().
checkPermissionStatus
(
PermissionGroup
.
contacts
);
...
@@ -47,7 +47,7 @@ PermissionStatus permission = await PermissionHandler().checkPermissionStatus(Pe
...
@@ -47,7 +47,7 @@ PermissionStatus permission = await PermissionHandler().checkPermissionStatus(Pe
### Checking service status
### Checking service status
```
dart
```
dart
import
'package:permission_handler/permission_handler.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
ServiceStatus
serviceStatus
=
await
PermissionHandler
().
checkServiceStatus
(
PermissionGroup
.
location
);
ServiceStatus
serviceStatus
=
await
PermissionHandler
().
checkServiceStatus
(
PermissionGroup
.
location
);
...
@@ -57,7 +57,7 @@ Checking the service status only makes sense for the `PermissionGroup.location`
...
@@ -57,7 +57,7 @@ Checking the service status only makes sense for the `PermissionGroup.location`
### Open app settings
### Open app settings
```
dart
```
dart
import
'package:permission_handler/permission_handler.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
bool
isOpened
=
await
PermissionHandler
().
openAppSettings
();
bool
isOpened
=
await
PermissionHandler
().
openAppSettings
();
...
@@ -65,7 +65,7 @@ bool isOpened = await PermissionHandler().openAppSettings();
...
@@ -65,7 +65,7 @@ bool isOpened = await PermissionHandler().openAppSettings();
### Show a rationale for requesting permission (Android only)
### Show a rationale for requesting permission (Android only)
```
dart
```
dart
import
'package:permission_handler/permission_handler.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
bool
isShown
=
await
PermissionHandler
().
shouldShowRequestPermissionRationale
(
PermissionGroup
.
contacts
);
bool
isShown
=
await
PermissionHandler
().
shouldShowRequestPermissionRationale
(
PermissionGroup
.
contacts
);
...
@@ -77,7 +77,7 @@ This will always return `false` on iOS.
...
@@ -77,7 +77,7 @@ This will always return `false` on iOS.
Defines the permission groups for which permissions can be checked or requested.
Defines the permission groups for which permissions can be checked or requested.
```
dart
```
dart
enum
PermissionGroup
{
enum
PermissionGroup
{
/// The unknown permission only used for return type, never requested
/// The unknown permission only used for return type, never requested
unknown
,
unknown
,
...
@@ -148,7 +148,7 @@ enum PermissionGroup {
...
@@ -148,7 +148,7 @@ enum PermissionGroup {
Defines the state of a permission group
Defines the state of a permission group
```
dart
```
dart
enum
PermissionStatus
{
enum
PermissionStatus
{
/// Permission to access the requested feature is denied by the user.
/// Permission to access the requested feature is denied by the user.
denied
,
denied
,
...
@@ -167,6 +167,27 @@ enum PermissionStatus {
...
@@ -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
## Issues
Please file any issues, bugs or feature request as an issue on our
[
GitHub
](
https://github.com/BaseflowIT/flutter-permission-handler/issues
)
page.
Please file any issues, bugs or feature request as an issue on our
[
GitHub
](
https://github.com/BaseflowIT/flutter-permission-handler/issues
)
page.
...
...
lib/permission_enums.dart
View file @
6b494eac
...
@@ -23,7 +23,7 @@ enum ServiceStatus {
...
@@ -23,7 +23,7 @@ enum ServiceStatus {
/// The unknown service status indicates the state of the service could not be determined.
/// The unknown service status indicates the state of the service could not be determined.
unknown
,
unknown
,
/// There is no
t separate
service for the supplied permission group.
/// There is no service for the supplied permission group.
notApplicable
,
notApplicable
,
/// The service for the supplied permission group is disabled.
/// The service for the supplied permission group is disabled.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment