flet-permission-handler 0.2.0.dev39__tar.gz → 0.2.0.dev60__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of flet-permission-handler might be problematic. Click here for more details.
- {flet_permission_handler-0.2.0.dev39/src/flet_permission_handler.egg-info → flet_permission_handler-0.2.0.dev60}/PKG-INFO +6 -4
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/README.md +5 -3
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/pyproject.toml +40 -14
- flet_permission_handler-0.2.0.dev60/src/flet_permission_handler/__init__.py +8 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flet_permission_handler/permission_handler.py +32 -14
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flet_permission_handler/types.py +62 -48
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60/src/flet_permission_handler.egg-info}/PKG-INFO +6 -4
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/lib/src/utils/permission_handler.dart +1 -5
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/pubspec.lock +54 -38
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/pubspec.yaml +1 -1
- flet_permission_handler-0.2.0.dev39/src/flet_permission_handler/__init__.py +0 -2
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/LICENSE +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/setup.cfg +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flet_permission_handler.egg-info/SOURCES.txt +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flet_permission_handler.egg-info/dependency_links.txt +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flet_permission_handler.egg-info/requires.txt +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flet_permission_handler.egg-info/top_level.txt +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/CHANGELOG.md +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/LICENSE +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/README.md +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/analysis_options.yaml +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/lib/flet_permission_handler.dart +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/lib/src/extension.dart +0 -0
- {flet_permission_handler-0.2.0.dev39 → flet_permission_handler-0.2.0.dev60}/src/flutter/flet_permission_handler/lib/src/permission_handler.dart +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-permission-handler
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev60
|
|
4
4
|
Summary: A Flet extension that simplifies working with permissions in your app.
|
|
5
5
|
Author-email: Flet contributors <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -46,7 +46,9 @@ This package supports the following platforms:
|
|
|
46
46
|
| Android | ✅ |
|
|
47
47
|
| Web | ✅ |
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Installation
|
|
50
52
|
|
|
51
53
|
To install the `flet-permission-handler` package and add it to your project dependencies:
|
|
52
54
|
|
|
@@ -66,6 +68,6 @@ To install the `flet-permission-handler` package and add it to your project depe
|
|
|
66
68
|
poetry add flet-permission-handler
|
|
67
69
|
```
|
|
68
70
|
|
|
69
|
-
|
|
71
|
+
### Examples
|
|
70
72
|
|
|
71
|
-
For examples, see [
|
|
73
|
+
For examples, see [these](./examples).
|
|
@@ -30,7 +30,9 @@ This package supports the following platforms:
|
|
|
30
30
|
| Android | ✅ |
|
|
31
31
|
| Web | ✅ |
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### Installation
|
|
34
36
|
|
|
35
37
|
To install the `flet-permission-handler` package and add it to your project dependencies:
|
|
36
38
|
|
|
@@ -50,6 +52,6 @@ To install the `flet-permission-handler` package and add it to your project depe
|
|
|
50
52
|
poetry add flet-permission-handler
|
|
51
53
|
```
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
### Examples
|
|
54
56
|
|
|
55
|
-
For examples, see [
|
|
57
|
+
For examples, see [these](./examples).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "flet-permission-handler"
|
|
3
|
-
version = "0.2.0.
|
|
3
|
+
version = "0.2.0.dev60"
|
|
4
4
|
description = "A Flet extension that simplifies working with permissions in your app."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -22,23 +22,48 @@ Issues = "https://github.com/flet-dev/flet-permission-handler/issues"
|
|
|
22
22
|
"flutter.flet_permission_handler" = ["**/*"]
|
|
23
23
|
|
|
24
24
|
[dependency-groups]
|
|
25
|
+
test = [
|
|
26
|
+
"pytest >=7.2.0",
|
|
27
|
+
]
|
|
28
|
+
lint = [
|
|
29
|
+
"ruff >=0.11.7",
|
|
30
|
+
]
|
|
25
31
|
dev = [
|
|
26
|
-
"pre-commit>=4.2.0",
|
|
27
|
-
|
|
32
|
+
"pre-commit >=4.2.0",
|
|
33
|
+
{ include-group = 'lint' },
|
|
34
|
+
{ include-group = 'test' },
|
|
35
|
+
]
|
|
36
|
+
docs-coverage = [
|
|
37
|
+
"docstr-coverage >=2.3.2",
|
|
28
38
|
]
|
|
29
39
|
docs = [
|
|
30
|
-
"mkdocs",
|
|
31
|
-
"mkdocs-material",
|
|
32
|
-
"mkdocstrings
|
|
33
|
-
"mkdocstrings-python-xref",
|
|
34
|
-
"mike",
|
|
35
|
-
"markdown>=3.6",
|
|
36
|
-
"pymdown-extensions",
|
|
37
|
-
"mkdocs-
|
|
38
|
-
"mkdocs-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
40
|
+
"mkdocs >=1.6.1",
|
|
41
|
+
"mkdocs-material >=9.6.15",
|
|
42
|
+
"mkdocstrings-python >=1.16.12",
|
|
43
|
+
"mkdocstrings-python-xref >=1.16.3",
|
|
44
|
+
"mike >=2.1.3",
|
|
45
|
+
"markdown >=3.6",
|
|
46
|
+
"pymdown-extensions >=10.16",
|
|
47
|
+
"mkdocs-exclude >=1.0.2",
|
|
48
|
+
"mkdocs-glightbox >=0.4.0",
|
|
49
|
+
"mkdocs-open-in-new-tab >=1.0.8",
|
|
50
|
+
"mkdocs-section-index >=0.3.10",
|
|
51
|
+
"griffe-modernized-annotations >=1.0.8",
|
|
52
|
+
"griffe-warnings-deprecated >=1.1.0",
|
|
53
|
+
"pygments >=2.16",
|
|
54
|
+
"markdown-exec[ansi] >=1.11.0",
|
|
55
|
+
"pydocstyle >=6.3.0",
|
|
56
|
+
"linkcheckmd >=1.4.0",
|
|
57
|
+
"mkdocs-external-images",
|
|
58
|
+
{ include-group = 'docs-coverage' },
|
|
41
59
|
]
|
|
60
|
+
all = [
|
|
61
|
+
{ include-group = 'dev' },
|
|
62
|
+
{ include-group = 'docs' },
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[tool.uv.sources]
|
|
66
|
+
mkdocs-external-images = { git = "https://github.com/flet-dev/mkdocs-external-images", tag = "v0.2.0" }
|
|
42
67
|
|
|
43
68
|
[build-system]
|
|
44
69
|
requires = ["setuptools"]
|
|
@@ -66,6 +91,7 @@ select = [
|
|
|
66
91
|
"I"
|
|
67
92
|
]
|
|
68
93
|
preview = true
|
|
94
|
+
pydocstyle = { convention = 'google' }
|
|
69
95
|
|
|
70
96
|
[tool.ruff.format]
|
|
71
97
|
quote-style = "double"
|
|
@@ -2,7 +2,7 @@ from typing import Optional
|
|
|
2
2
|
|
|
3
3
|
import flet as ft
|
|
4
4
|
|
|
5
|
-
from .types import Permission, PermissionStatus
|
|
5
|
+
from flet_permission_handler.types import Permission, PermissionStatus
|
|
6
6
|
|
|
7
7
|
__all__ = ["PermissionHandler"]
|
|
8
8
|
|
|
@@ -12,10 +12,12 @@ class PermissionHandler(ft.Service):
|
|
|
12
12
|
"""
|
|
13
13
|
Manages permissions for the application.
|
|
14
14
|
|
|
15
|
-
This control is non-visual and should be added
|
|
15
|
+
This control is non-visual and should be added
|
|
16
|
+
to [`Page.services`][flet.Page.services] list.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
Danger: Platform support
|
|
18
19
|
Currently only supported on Android, iOS, Windows, and Web platforms.
|
|
20
|
+
|
|
19
21
|
Raises:
|
|
20
22
|
FletUnsupportedPlatformException: If the platform is not supported.
|
|
21
23
|
"""
|
|
@@ -34,10 +36,11 @@ class PermissionHandler(ft.Service):
|
|
|
34
36
|
]
|
|
35
37
|
):
|
|
36
38
|
raise ft.FletUnsupportedPlatformException(
|
|
37
|
-
"PermissionHandler is currently only supported on Android, iOS,
|
|
39
|
+
"PermissionHandler is currently only supported on Android, iOS, "
|
|
40
|
+
"Windows, and Web platforms."
|
|
38
41
|
)
|
|
39
42
|
|
|
40
|
-
async def
|
|
43
|
+
async def get_status(
|
|
41
44
|
self, permission: Permission, timeout: int = 10
|
|
42
45
|
) -> Optional[PermissionStatus]:
|
|
43
46
|
"""
|
|
@@ -46,44 +49,59 @@ class PermissionHandler(ft.Service):
|
|
|
46
49
|
Args:
|
|
47
50
|
permission: The `Permission` to check the status for.
|
|
48
51
|
timeout: The maximum amount of time (in seconds) to wait for a response.
|
|
52
|
+
|
|
49
53
|
Returns:
|
|
50
54
|
A `PermissionStatus` if the status is known, otherwise `None`.
|
|
55
|
+
|
|
51
56
|
Raises:
|
|
52
57
|
TimeoutError: If the request times out.
|
|
53
58
|
"""
|
|
54
|
-
status = await self.
|
|
55
|
-
"get_status",
|
|
59
|
+
status = await self._invoke_method(
|
|
60
|
+
method_name="get_status",
|
|
61
|
+
arguments={"permission": permission},
|
|
62
|
+
timeout=timeout,
|
|
56
63
|
)
|
|
57
64
|
return PermissionStatus(status) if status is not None else None
|
|
58
65
|
|
|
59
|
-
async def
|
|
66
|
+
async def request(
|
|
60
67
|
self, permission: Permission, timeout: int = 60
|
|
61
68
|
) -> Optional[PermissionStatus]:
|
|
62
69
|
"""
|
|
63
|
-
Request the user for access to the `permission` if access hasn't already been
|
|
70
|
+
Request the user for access to the `permission` if access hasn't already been
|
|
71
|
+
granted access before.
|
|
64
72
|
|
|
65
73
|
Args:
|
|
66
74
|
permission: The `Permission` to request.
|
|
67
75
|
timeout: The maximum amount of time (in seconds) to wait for a response.
|
|
76
|
+
|
|
68
77
|
Returns:
|
|
69
|
-
The new `PermissionStatus` after the request, or `None` if the request
|
|
78
|
+
The new `PermissionStatus` after the request, or `None` if the request
|
|
79
|
+
was not successful.
|
|
80
|
+
|
|
70
81
|
Raises:
|
|
71
82
|
TimeoutError: If the request times out.
|
|
72
83
|
"""
|
|
73
|
-
r = await self.
|
|
74
|
-
"request",
|
|
84
|
+
r = await self._invoke_method(
|
|
85
|
+
method_name="request",
|
|
86
|
+
arguments={"permission": permission},
|
|
87
|
+
timeout=timeout,
|
|
75
88
|
)
|
|
76
89
|
return PermissionStatus(r) if r is not None else None
|
|
77
90
|
|
|
78
|
-
async def
|
|
91
|
+
async def open_app_settings(self, timeout: int = 10) -> bool:
|
|
79
92
|
"""
|
|
80
93
|
Opens the app settings page.
|
|
81
94
|
|
|
82
95
|
Args:
|
|
83
96
|
timeout: The maximum amount of time (in seconds) to wait for a response.
|
|
97
|
+
|
|
84
98
|
Returns:
|
|
85
99
|
`True` if the app settings page could be opened, otherwise `False`.
|
|
100
|
+
|
|
86
101
|
Raises:
|
|
87
102
|
TimeoutError: If the request times out.
|
|
88
103
|
"""
|
|
89
|
-
return await self.
|
|
104
|
+
return await self._invoke_method(
|
|
105
|
+
method_name="open_app_settings",
|
|
106
|
+
timeout=timeout,
|
|
107
|
+
)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
2
|
|
|
3
3
|
__all__ = [
|
|
4
|
-
"PermissionStatus",
|
|
5
4
|
"Permission",
|
|
5
|
+
"PermissionStatus",
|
|
6
6
|
]
|
|
7
7
|
|
|
8
8
|
|
|
@@ -21,22 +21,23 @@ class PermissionStatus(Enum):
|
|
|
21
21
|
|
|
22
22
|
PERMANENTLY_DENIED = "permanentlyDenied"
|
|
23
23
|
"""
|
|
24
|
-
Permission to the requested feature is permanently denied,
|
|
25
|
-
the permission dialog will not be shown when requesting this permission.
|
|
24
|
+
Permission to the requested feature is permanently denied,
|
|
25
|
+
the permission dialog will not be shown when requesting this permission.
|
|
26
26
|
The user may still change the permission status in the settings.
|
|
27
27
|
|
|
28
28
|
Note:
|
|
29
|
-
- On Android:
|
|
30
|
-
- Android 11+ (API 30+): whether the user denied the permission
|
|
31
|
-
|
|
32
|
-
- Below Android 11 (API 30): whether the user denied access
|
|
29
|
+
- On Android:
|
|
30
|
+
- Android 11+ (API 30+): whether the user denied the permission
|
|
31
|
+
for a second time.
|
|
32
|
+
- Below Android 11 (API 30): whether the user denied access
|
|
33
33
|
to the requested feature and selected to never again show a request.
|
|
34
34
|
- On iOS: If the user has denied access to the requested feature.
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
37
|
LIMITED = "limited"
|
|
38
38
|
"""
|
|
39
|
-
The user has authorized this application for limited access.
|
|
39
|
+
The user has authorized this application for limited access.
|
|
40
|
+
So far this is only relevant for the Photo Library picker.
|
|
40
41
|
|
|
41
42
|
Note:
|
|
42
43
|
Only supported on iOS (iOS14+) and Android (Android 14+).
|
|
@@ -44,7 +45,8 @@ class PermissionStatus(Enum):
|
|
|
44
45
|
|
|
45
46
|
PROVISIONAL = "provisional"
|
|
46
47
|
"""
|
|
47
|
-
The application is provisionally authorized to post non-interruptive
|
|
48
|
+
The application is provisionally authorized to post non-interruptive
|
|
49
|
+
user notifications.
|
|
48
50
|
|
|
49
51
|
Note:
|
|
50
52
|
Only supported on iOS (iOS 12+).
|
|
@@ -52,14 +54,17 @@ class PermissionStatus(Enum):
|
|
|
52
54
|
|
|
53
55
|
RESTRICTED = "restricted"
|
|
54
56
|
"""
|
|
55
|
-
The OS denied access to the requested feature. The user cannot change
|
|
57
|
+
The OS denied access to the requested feature. The user cannot change
|
|
58
|
+
this app's status, possibly due to active restrictions such as parental
|
|
59
|
+
controls being in place.
|
|
56
60
|
|
|
57
61
|
Note:
|
|
58
62
|
Only supported on iOS.
|
|
59
63
|
"""
|
|
60
64
|
|
|
61
65
|
|
|
62
|
-
# todo: show how pyproject config for each could look like for each permission
|
|
66
|
+
# todo: show how pyproject config for each could look like for each permission
|
|
67
|
+
# (what exactly is needed in manifest, plist, etc.)
|
|
63
68
|
|
|
64
69
|
|
|
65
70
|
class Permission(Enum):
|
|
@@ -68,7 +73,7 @@ class Permission(Enum):
|
|
|
68
73
|
ACCESS_MEDIA_LOCATION = "accessMediaLocation"
|
|
69
74
|
"""
|
|
70
75
|
Permission for accessing the device's media library.
|
|
71
|
-
|
|
76
|
+
|
|
72
77
|
Allows an application to access any geographic locations persisted in the
|
|
73
78
|
user's shared collection.
|
|
74
79
|
|
|
@@ -79,10 +84,10 @@ class Permission(Enum):
|
|
|
79
84
|
ACCESS_NOTIFICATION_POLICY = "accessNotificationPolicy"
|
|
80
85
|
"""
|
|
81
86
|
Permission for accessing the device's notification policy.
|
|
82
|
-
|
|
87
|
+
|
|
83
88
|
Allows the user to access the notification policy of the phone.
|
|
84
89
|
Example: Allows app to turn on and off do-not-disturb.
|
|
85
|
-
|
|
90
|
+
|
|
86
91
|
Note:
|
|
87
92
|
Only supported on Android Marshmallow+ (API 23+) only.
|
|
88
93
|
"""
|
|
@@ -101,7 +106,7 @@ class Permission(Enum):
|
|
|
101
106
|
Allows user to accept that your app collects data about end users and
|
|
102
107
|
shares it with other companies for purposes of tracking across apps and
|
|
103
108
|
websites.
|
|
104
|
-
|
|
109
|
+
|
|
105
110
|
Note:
|
|
106
111
|
Only supported on iOS only.
|
|
107
112
|
"""
|
|
@@ -116,7 +121,7 @@ class Permission(Enum):
|
|
|
116
121
|
AUDIO = "audio"
|
|
117
122
|
"""
|
|
118
123
|
Permission for accessing the device's audio files from external storage.
|
|
119
|
-
|
|
124
|
+
|
|
120
125
|
Note:
|
|
121
126
|
Only supported on Android 13+ (API 33+) only.
|
|
122
127
|
"""
|
|
@@ -124,7 +129,7 @@ class Permission(Enum):
|
|
|
124
129
|
BACKGROUND_REFRESH = "backgroundRefresh"
|
|
125
130
|
"""
|
|
126
131
|
Permission for reading the current background refresh status.
|
|
127
|
-
|
|
132
|
+
|
|
128
133
|
Note:
|
|
129
134
|
Only supported on iOS only.
|
|
130
135
|
"""
|
|
@@ -134,7 +139,7 @@ class Permission(Enum):
|
|
|
134
139
|
Permission for accessing the device's bluetooth adapter state.
|
|
135
140
|
|
|
136
141
|
Depending on the platform and version, the requirements are slightly different:
|
|
137
|
-
|
|
142
|
+
|
|
138
143
|
Info:
|
|
139
144
|
- Android: always allowed.
|
|
140
145
|
- iOS:
|
|
@@ -155,7 +160,7 @@ class Permission(Enum):
|
|
|
155
160
|
"""
|
|
156
161
|
Permission for connecting to Bluetooth devices.
|
|
157
162
|
Allows the user to connect with already paired Bluetooth devices.
|
|
158
|
-
|
|
163
|
+
|
|
159
164
|
Note:
|
|
160
165
|
Only supported on Android 12+ (API 31+) only.
|
|
161
166
|
"""
|
|
@@ -177,7 +182,8 @@ class Permission(Enum):
|
|
|
177
182
|
"""
|
|
178
183
|
Permission for writing to the device's calendar.
|
|
179
184
|
|
|
180
|
-
On iOS 16 and lower, this permission is identical to
|
|
185
|
+
On iOS 16 and lower, this permission is identical to
|
|
186
|
+
[`CALENDAR_FULL_ACCESS`][..].
|
|
181
187
|
"""
|
|
182
188
|
|
|
183
189
|
CAMERA = "camera"
|
|
@@ -202,7 +208,7 @@ class Permission(Enum):
|
|
|
202
208
|
"""
|
|
203
209
|
Permission for sending critical alerts.
|
|
204
210
|
Allow for sending notifications that override the ringer.
|
|
205
|
-
|
|
211
|
+
|
|
206
212
|
Note:
|
|
207
213
|
Only supported on iOS only.
|
|
208
214
|
"""
|
|
@@ -210,7 +216,7 @@ class Permission(Enum):
|
|
|
210
216
|
IGNORE_BATTERY_OPTIMIZATIONS = "ignoreBatteryOptimizations"
|
|
211
217
|
"""
|
|
212
218
|
Permission for accessing ignore battery optimizations.
|
|
213
|
-
|
|
219
|
+
|
|
214
220
|
Note:
|
|
215
221
|
Only supported on Android only.
|
|
216
222
|
"""
|
|
@@ -232,8 +238,9 @@ class Permission(Enum):
|
|
|
232
238
|
|
|
233
239
|
LOCATION_WHEN_IN_USE = "locationWhenInUse"
|
|
234
240
|
"""
|
|
235
|
-
Permission for accessing the device's location when the app is
|
|
236
|
-
|
|
241
|
+
Permission for accessing the device's location when the app is
|
|
242
|
+
running in the foreground.
|
|
243
|
+
|
|
237
244
|
Info:
|
|
238
245
|
- Android: Fine and Coarse Location
|
|
239
246
|
- iOS: CoreLocation - WhenInUse
|
|
@@ -243,21 +250,24 @@ class Permission(Enum):
|
|
|
243
250
|
"""
|
|
244
251
|
Permission for accessing the device's external storage.
|
|
245
252
|
Allows an application a broad access to external storage in scoped storage.
|
|
246
|
-
|
|
247
|
-
You should request this permission only when your app cannot
|
|
253
|
+
|
|
254
|
+
You should request this permission only when your app cannot
|
|
248
255
|
effectively make use of the more privacy-friendly APIs.
|
|
249
|
-
For more information:
|
|
250
|
-
|
|
256
|
+
For more information:
|
|
257
|
+
https://developer.android.com/training/data-storage/manage-all-files
|
|
258
|
+
|
|
251
259
|
Info:
|
|
252
260
|
When the privacy-friendly APIs (i.e. [Storage Access Framework](https://developer.android.com/guide/topics/providers/document-provider)
|
|
253
261
|
or the [MediaStore](https://developer.android.com/training/data-storage/shared/media) APIs)
|
|
254
262
|
is all your app needs, the [PermissionGroup.storage] are the only
|
|
255
263
|
permissions you need to request.
|
|
256
|
-
|
|
257
|
-
If the usage of this permission is needed, you have to fill out
|
|
258
|
-
the Permission Declaration Form upon submitting your app to the
|
|
259
|
-
|
|
260
|
-
|
|
264
|
+
|
|
265
|
+
If the usage of this permission is needed, you have to fill out
|
|
266
|
+
the Permission Declaration Form upon submitting your app to the
|
|
267
|
+
Google Play Store.
|
|
268
|
+
More details:
|
|
269
|
+
https://support.google.com/googleplay/android-developer/answer/9214102#zippy=
|
|
270
|
+
|
|
261
271
|
Note:
|
|
262
272
|
Only supported on Android 11+ (API 30+) only.
|
|
263
273
|
"""
|
|
@@ -265,7 +275,7 @@ class Permission(Enum):
|
|
|
265
275
|
MEDIA_LIBRARY = "mediaLibrary"
|
|
266
276
|
"""
|
|
267
277
|
Permission for accessing the device's media library.
|
|
268
|
-
|
|
278
|
+
|
|
269
279
|
Note:
|
|
270
280
|
Only supported on iOS 9.3+ only
|
|
271
281
|
"""
|
|
@@ -291,7 +301,7 @@ class Permission(Enum):
|
|
|
291
301
|
PHONE = "phone"
|
|
292
302
|
"""
|
|
293
303
|
Permission for accessing the device's phone state.
|
|
294
|
-
|
|
304
|
+
|
|
295
305
|
Note:
|
|
296
306
|
Only supported on Android only.
|
|
297
307
|
"""
|
|
@@ -300,7 +310,7 @@ class Permission(Enum):
|
|
|
300
310
|
"""
|
|
301
311
|
Permission for accessing (read & write) the device's photos.
|
|
302
312
|
|
|
303
|
-
If you only want to add photos, you can use
|
|
313
|
+
If you only want to add photos, you can use
|
|
304
314
|
the `PHOTOS_ADD_ONLY` permission instead (iOS only).
|
|
305
315
|
"""
|
|
306
316
|
|
|
@@ -309,7 +319,7 @@ class Permission(Enum):
|
|
|
309
319
|
Permission for adding photos to the device's photo library (iOS only).
|
|
310
320
|
|
|
311
321
|
If you want to read them as well, use the `Permission.PHOTOS` permission instead.
|
|
312
|
-
|
|
322
|
+
|
|
313
323
|
Info:
|
|
314
324
|
iOS: Photos (14+ read & write access level)
|
|
315
325
|
"""
|
|
@@ -317,7 +327,7 @@ class Permission(Enum):
|
|
|
317
327
|
REMINDERS = "reminders"
|
|
318
328
|
"""
|
|
319
329
|
Permission for accessing the device's reminders.
|
|
320
|
-
|
|
330
|
+
|
|
321
331
|
Note:
|
|
322
332
|
Only supported on iOS only.
|
|
323
333
|
"""
|
|
@@ -325,7 +335,7 @@ class Permission(Enum):
|
|
|
325
335
|
REQUEST_INSTALL_PACKAGES = "requestInstallPackages"
|
|
326
336
|
"""
|
|
327
337
|
Permission for requesting installing packages.
|
|
328
|
-
|
|
338
|
+
|
|
329
339
|
Note:
|
|
330
340
|
Only supported on Android Marshmallow+ (API 23+) only.
|
|
331
341
|
"""
|
|
@@ -341,7 +351,7 @@ class Permission(Enum):
|
|
|
341
351
|
SENSORS = "sensors"
|
|
342
352
|
"""
|
|
343
353
|
Permission for accessing the device's sensors.
|
|
344
|
-
|
|
354
|
+
|
|
345
355
|
Info:
|
|
346
356
|
- Android: Body Sensors
|
|
347
357
|
- iOS: CoreMotion
|
|
@@ -365,8 +375,10 @@ class Permission(Enum):
|
|
|
365
375
|
Permission for accessing speech recognition.
|
|
366
376
|
|
|
367
377
|
Info:
|
|
368
|
-
- Android: Requests access to microphone
|
|
369
|
-
|
|
378
|
+
- Android: Requests access to microphone
|
|
379
|
+
(identical to requesting [`MICROPHONE`][..]).
|
|
380
|
+
- iOS: Requests speech access (different from requesting
|
|
381
|
+
[`MICROPHONE`][..]).
|
|
370
382
|
"""
|
|
371
383
|
|
|
372
384
|
STORAGE = "storage"
|
|
@@ -374,14 +386,16 @@ class Permission(Enum):
|
|
|
374
386
|
Permission for accessing external storage.
|
|
375
387
|
|
|
376
388
|
Depending on the platform and version, the requirements are slightly different:
|
|
377
|
-
|
|
389
|
+
|
|
378
390
|
Info:
|
|
379
391
|
- Android:
|
|
380
392
|
- On Android 13 (API 33) and above, this permission is deprecated and
|
|
381
393
|
always returns `PermissionStatus.denied`. Instead use `Permission.PHOTOS`,
|
|
382
|
-
`Permission.VIDEO`, `Permission.AUDIO` or
|
|
383
|
-
|
|
384
|
-
|
|
394
|
+
`Permission.VIDEO`, `Permission.AUDIO` or
|
|
395
|
+
`Permission.MANAGE_EXTERNAL_STORAGE`.
|
|
396
|
+
For more information see
|
|
397
|
+
[this](https://pub.dev/packages/permission_handler#faq).
|
|
398
|
+
|
|
385
399
|
- Below Android 13 (API 33), the `READ_EXTERNAL_STORAGE` and
|
|
386
400
|
`WRITE_EXTERNAL_STORAGE` permissions are requested (depending on the
|
|
387
401
|
definitions in the AndroidManifest.xml) file.
|
|
@@ -392,7 +406,7 @@ class Permission(Enum):
|
|
|
392
406
|
"""
|
|
393
407
|
Permission for creating system alert window.
|
|
394
408
|
Allows an app to create windows shown on top of all other apps.
|
|
395
|
-
|
|
409
|
+
|
|
396
410
|
Note:
|
|
397
411
|
Only supported on Android only.
|
|
398
412
|
"""
|
|
@@ -405,7 +419,7 @@ class Permission(Enum):
|
|
|
405
419
|
VIDEOS = "videos"
|
|
406
420
|
"""
|
|
407
421
|
Permission for accessing the device's video files from external storage.
|
|
408
|
-
|
|
422
|
+
|
|
409
423
|
Note:
|
|
410
424
|
Only supported on Android 13+ (API 33+) only.
|
|
411
425
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: flet-permission-handler
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev60
|
|
4
4
|
Summary: A Flet extension that simplifies working with permissions in your app.
|
|
5
5
|
Author-email: Flet contributors <hello@flet.dev>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -46,7 +46,9 @@ This package supports the following platforms:
|
|
|
46
46
|
| Android | ✅ |
|
|
47
47
|
| Web | ✅ |
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Installation
|
|
50
52
|
|
|
51
53
|
To install the `flet-permission-handler` package and add it to your project dependencies:
|
|
52
54
|
|
|
@@ -66,6 +68,6 @@ To install the `flet-permission-handler` package and add it to your project depe
|
|
|
66
68
|
poetry add flet-permission-handler
|
|
67
69
|
```
|
|
68
70
|
|
|
69
|
-
|
|
71
|
+
### Examples
|
|
70
72
|
|
|
71
|
-
For examples, see [
|
|
73
|
+
For examples, see [these](./examples).
|
|
@@ -5,11 +5,7 @@ Permission? parsePermission(String? value, [Permission? defaultValue]) {
|
|
|
5
5
|
if (value == null) return defaultValue;
|
|
6
6
|
return Permission.values.firstWhereOrNull(
|
|
7
7
|
(Permission p) =>
|
|
8
|
-
|
|
9
|
-
.toString()
|
|
10
|
-
.split('.')
|
|
11
|
-
.last
|
|
12
|
-
.toLowerCase() == value.toLowerCase(),
|
|
8
|
+
p.toString().split('.').last.toLowerCase() == value.toLowerCase(),
|
|
13
9
|
) ??
|
|
14
10
|
defaultValue;
|
|
15
11
|
}
|
|
@@ -13,10 +13,10 @@ packages:
|
|
|
13
13
|
dependency: transitive
|
|
14
14
|
description:
|
|
15
15
|
name: async
|
|
16
|
-
sha256:
|
|
16
|
+
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
|
17
17
|
url: "https://pub.dev"
|
|
18
18
|
source: hosted
|
|
19
|
-
version: "2.
|
|
19
|
+
version: "2.13.0"
|
|
20
20
|
boolean_selector:
|
|
21
21
|
dependency: transitive
|
|
22
22
|
description:
|
|
@@ -65,6 +65,14 @@ packages:
|
|
|
65
65
|
url: "https://pub.dev"
|
|
66
66
|
source: hosted
|
|
67
67
|
version: "3.0.6"
|
|
68
|
+
dbus:
|
|
69
|
+
dependency: transitive
|
|
70
|
+
description:
|
|
71
|
+
name: dbus
|
|
72
|
+
sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c"
|
|
73
|
+
url: "https://pub.dev"
|
|
74
|
+
source: hosted
|
|
75
|
+
version: "0.7.11"
|
|
68
76
|
device_info_plus:
|
|
69
77
|
dependency: transitive
|
|
70
78
|
description:
|
|
@@ -93,10 +101,10 @@ packages:
|
|
|
93
101
|
dependency: transitive
|
|
94
102
|
description:
|
|
95
103
|
name: fake_async
|
|
96
|
-
sha256: "
|
|
104
|
+
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
|
97
105
|
url: "https://pub.dev"
|
|
98
106
|
source: hosted
|
|
99
|
-
version: "1.3.
|
|
107
|
+
version: "1.3.3"
|
|
100
108
|
ffi:
|
|
101
109
|
dependency: transitive
|
|
102
110
|
description:
|
|
@@ -117,16 +125,16 @@ packages:
|
|
|
117
125
|
dependency: transitive
|
|
118
126
|
description:
|
|
119
127
|
name: file_picker
|
|
120
|
-
sha256:
|
|
128
|
+
sha256: ef7d2a085c1b1d69d17b6842d0734aad90156de08df6bd3c12496d0bd6ddf8e2
|
|
121
129
|
url: "https://pub.dev"
|
|
122
130
|
source: hosted
|
|
123
|
-
version: "10.
|
|
131
|
+
version: "10.3.1"
|
|
124
132
|
flet:
|
|
125
133
|
dependency: "direct main"
|
|
126
134
|
description:
|
|
127
135
|
path: "packages/flet"
|
|
128
136
|
ref: main
|
|
129
|
-
resolved-ref:
|
|
137
|
+
resolved-ref: "4ea9558543657d31dba3b11d6017beed2e16d447"
|
|
130
138
|
url: "https://github.com/flet-dev/flet.git"
|
|
131
139
|
source: git
|
|
132
140
|
version: "0.70.0"
|
|
@@ -147,10 +155,10 @@ packages:
|
|
|
147
155
|
dependency: "direct dev"
|
|
148
156
|
description:
|
|
149
157
|
name: flutter_lints
|
|
150
|
-
sha256:
|
|
158
|
+
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
|
|
151
159
|
url: "https://pub.dev"
|
|
152
160
|
source: hosted
|
|
153
|
-
version: "
|
|
161
|
+
version: "3.0.2"
|
|
154
162
|
flutter_localizations:
|
|
155
163
|
dependency: transitive
|
|
156
164
|
description: flutter
|
|
@@ -168,10 +176,10 @@ packages:
|
|
|
168
176
|
dependency: transitive
|
|
169
177
|
description:
|
|
170
178
|
name: flutter_plugin_android_lifecycle
|
|
171
|
-
sha256:
|
|
179
|
+
sha256: "6382ce712ff69b0f719640ce957559dde459e55ecd433c767e06d139ddf16cab"
|
|
172
180
|
url: "https://pub.dev"
|
|
173
181
|
source: hosted
|
|
174
|
-
version: "2.0.
|
|
182
|
+
version: "2.0.29"
|
|
175
183
|
flutter_svg:
|
|
176
184
|
dependency: transitive
|
|
177
185
|
description:
|
|
@@ -218,10 +226,10 @@ packages:
|
|
|
218
226
|
dependency: transitive
|
|
219
227
|
description:
|
|
220
228
|
name: intl
|
|
221
|
-
sha256:
|
|
229
|
+
sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5"
|
|
222
230
|
url: "https://pub.dev"
|
|
223
231
|
source: hosted
|
|
224
|
-
version: "0.
|
|
232
|
+
version: "0.20.2"
|
|
225
233
|
json_annotation:
|
|
226
234
|
dependency: transitive
|
|
227
235
|
description:
|
|
@@ -234,10 +242,10 @@ packages:
|
|
|
234
242
|
dependency: transitive
|
|
235
243
|
description:
|
|
236
244
|
name: leak_tracker
|
|
237
|
-
sha256:
|
|
245
|
+
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
|
|
238
246
|
url: "https://pub.dev"
|
|
239
247
|
source: hosted
|
|
240
|
-
version: "10.0.
|
|
248
|
+
version: "10.0.9"
|
|
241
249
|
leak_tracker_flutter_testing:
|
|
242
250
|
dependency: transitive
|
|
243
251
|
description:
|
|
@@ -258,10 +266,10 @@ packages:
|
|
|
258
266
|
dependency: transitive
|
|
259
267
|
description:
|
|
260
268
|
name: lints
|
|
261
|
-
sha256:
|
|
269
|
+
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
|
|
262
270
|
url: "https://pub.dev"
|
|
263
271
|
source: hosted
|
|
264
|
-
version: "
|
|
272
|
+
version: "3.0.0"
|
|
265
273
|
logging:
|
|
266
274
|
dependency: transitive
|
|
267
275
|
description:
|
|
@@ -354,10 +362,10 @@ packages:
|
|
|
354
362
|
dependency: transitive
|
|
355
363
|
description:
|
|
356
364
|
name: path_provider_foundation
|
|
357
|
-
sha256: "
|
|
365
|
+
sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"
|
|
358
366
|
url: "https://pub.dev"
|
|
359
367
|
source: hosted
|
|
360
|
-
version: "2.4.
|
|
368
|
+
version: "2.4.2"
|
|
361
369
|
path_provider_linux:
|
|
362
370
|
dependency: transitive
|
|
363
371
|
description:
|
|
@@ -502,14 +510,22 @@ packages:
|
|
|
502
510
|
url: "https://pub.dev"
|
|
503
511
|
source: hosted
|
|
504
512
|
version: "0.2.0"
|
|
513
|
+
screenshot:
|
|
514
|
+
dependency: transitive
|
|
515
|
+
description:
|
|
516
|
+
name: screenshot
|
|
517
|
+
sha256: "63817697a7835e6ce82add4228e15d233b74d42975c143ad8cfe07009fab866b"
|
|
518
|
+
url: "https://pub.dev"
|
|
519
|
+
source: hosted
|
|
520
|
+
version: "3.0.0"
|
|
505
521
|
sensors_plus:
|
|
506
522
|
dependency: transitive
|
|
507
523
|
description:
|
|
508
524
|
name: sensors_plus
|
|
509
|
-
sha256: "
|
|
525
|
+
sha256: "89e2bfc3d883743539ce5774a2b93df61effde40ff958ecad78cd66b1a8b8d52"
|
|
510
526
|
url: "https://pub.dev"
|
|
511
527
|
source: hosted
|
|
512
|
-
version: "6.1.
|
|
528
|
+
version: "6.1.2"
|
|
513
529
|
sensors_plus_platform_interface:
|
|
514
530
|
dependency: transitive
|
|
515
531
|
description:
|
|
@@ -530,10 +546,10 @@ packages:
|
|
|
530
546
|
dependency: transitive
|
|
531
547
|
description:
|
|
532
548
|
name: shared_preferences_android
|
|
533
|
-
sha256: "
|
|
549
|
+
sha256: "5bcf0772a761b04f8c6bf814721713de6f3e5d9d89caf8d3fe031b02a342379e"
|
|
534
550
|
url: "https://pub.dev"
|
|
535
551
|
source: hosted
|
|
536
|
-
version: "2.4.
|
|
552
|
+
version: "2.4.11"
|
|
537
553
|
shared_preferences_foundation:
|
|
538
554
|
dependency: transitive
|
|
539
555
|
description:
|
|
@@ -647,18 +663,18 @@ packages:
|
|
|
647
663
|
dependency: transitive
|
|
648
664
|
description:
|
|
649
665
|
name: url_launcher_android
|
|
650
|
-
sha256: "
|
|
666
|
+
sha256: "0aedad096a85b49df2e4725fa32118f9fa580f3b14af7a2d2221896a02cd5656"
|
|
651
667
|
url: "https://pub.dev"
|
|
652
668
|
source: hosted
|
|
653
|
-
version: "6.3.
|
|
669
|
+
version: "6.3.17"
|
|
654
670
|
url_launcher_ios:
|
|
655
671
|
dependency: transitive
|
|
656
672
|
description:
|
|
657
673
|
name: url_launcher_ios
|
|
658
|
-
sha256:
|
|
674
|
+
sha256: d80b3f567a617cb923546034cc94bfe44eb15f989fe670b37f26abdb9d939cb7
|
|
659
675
|
url: "https://pub.dev"
|
|
660
676
|
source: hosted
|
|
661
|
-
version: "6.3.
|
|
677
|
+
version: "6.3.4"
|
|
662
678
|
url_launcher_linux:
|
|
663
679
|
dependency: transitive
|
|
664
680
|
description:
|
|
@@ -671,10 +687,10 @@ packages:
|
|
|
671
687
|
dependency: transitive
|
|
672
688
|
description:
|
|
673
689
|
name: url_launcher_macos
|
|
674
|
-
sha256:
|
|
690
|
+
sha256: c043a77d6600ac9c38300567f33ef12b0ef4f4783a2c1f00231d2b1941fea13f
|
|
675
691
|
url: "https://pub.dev"
|
|
676
692
|
source: hosted
|
|
677
|
-
version: "3.2.
|
|
693
|
+
version: "3.2.3"
|
|
678
694
|
url_launcher_platform_interface:
|
|
679
695
|
dependency: transitive
|
|
680
696
|
description:
|
|
@@ -719,10 +735,10 @@ packages:
|
|
|
719
735
|
dependency: transitive
|
|
720
736
|
description:
|
|
721
737
|
name: vector_graphics_compiler
|
|
722
|
-
sha256:
|
|
738
|
+
sha256: ca81fdfaf62a5ab45d7296614aea108d2c7d0efca8393e96174bf4d51e6725b0
|
|
723
739
|
url: "https://pub.dev"
|
|
724
740
|
source: hosted
|
|
725
|
-
version: "1.1.
|
|
741
|
+
version: "1.1.18"
|
|
726
742
|
vector_math:
|
|
727
743
|
dependency: transitive
|
|
728
744
|
description:
|
|
@@ -735,10 +751,10 @@ packages:
|
|
|
735
751
|
dependency: transitive
|
|
736
752
|
description:
|
|
737
753
|
name: vm_service
|
|
738
|
-
sha256:
|
|
754
|
+
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
|
|
739
755
|
url: "https://pub.dev"
|
|
740
756
|
source: hosted
|
|
741
|
-
version: "
|
|
757
|
+
version: "15.0.0"
|
|
742
758
|
web:
|
|
743
759
|
dependency: transitive
|
|
744
760
|
description:
|
|
@@ -767,10 +783,10 @@ packages:
|
|
|
767
783
|
dependency: transitive
|
|
768
784
|
description:
|
|
769
785
|
name: win32
|
|
770
|
-
sha256: "
|
|
786
|
+
sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03"
|
|
771
787
|
url: "https://pub.dev"
|
|
772
788
|
source: hosted
|
|
773
|
-
version: "5.
|
|
789
|
+
version: "5.14.0"
|
|
774
790
|
win32_registry:
|
|
775
791
|
dependency: transitive
|
|
776
792
|
description:
|
|
@@ -783,10 +799,10 @@ packages:
|
|
|
783
799
|
dependency: transitive
|
|
784
800
|
description:
|
|
785
801
|
name: window_manager
|
|
786
|
-
sha256: "
|
|
802
|
+
sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd"
|
|
787
803
|
url: "https://pub.dev"
|
|
788
804
|
source: hosted
|
|
789
|
-
version: "0.5.
|
|
805
|
+
version: "0.5.1"
|
|
790
806
|
window_to_front:
|
|
791
807
|
dependency: transitive
|
|
792
808
|
description:
|
|
@@ -812,5 +828,5 @@ packages:
|
|
|
812
828
|
source: hosted
|
|
813
829
|
version: "6.5.0"
|
|
814
830
|
sdks:
|
|
815
|
-
dart: ">=3.
|
|
831
|
+
dart: ">=3.8.0 <4.0.0"
|
|
816
832
|
flutter: ">=3.29.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|