PermissionHandler
PermissionHandler can check and/or request permissions from the running device for access to various components. Works on Windows, iOS, Android and web. Based on the permission_handler Dart/Flutter package.
PermissionHandler control is non-visual and should be added to page.overlay
list.
To build your Flet app that uses PermissionHandler
control add flet-permission-handler
to dependencies
key of the [project]
section of your pyproject.toml
file, for
example:
[project]
...
dependencies = [
"flet==0.27.6",
"flet-premission-handler==0.1.0",
]
Examples
Basic Example
loading...
Methods
check_permission(of: PermissionType)
Checks the status of the specified PermissionType
.
Returns an instance of type PermissionStatus
.
open_app_settings()
Opens the device's settings. Before calling this method, you usually want to briefly remind the user of which permission is needed and how/where precisely it is to be enabled.
Returns a boolean value: True
if the device's settings were opened successfully, False
otherwise.
request_permission(of: PermissionType)
Requests the device for access to the specified PermissionType
from the user.
Returns an instance of type PermissionStatus
.