@@ -15,9 +15,8 @@ class PermissionHandler(ft.Service):
1515 This control is non-visual and should be added
1616 to [`Page.services`][flet.Page.services] list.
1717
18- Note:
19- Currently only supported on Android, iOS,
20- Windows, and Web platforms.
18+ Danger: Platform support
19+ Currently only supported on Android, iOS, Windows, and Web platforms.
2120
2221 Raises:
2322 FletUnsupportedPlatformException: If the platform is not supported.
@@ -37,7 +36,8 @@ def before_update(self):
3736 ]
3837 ):
3938 raise ft .FletUnsupportedPlatformException (
40- "PermissionHandler is currently only supported on Android, iOS, Windows, and Web platforms."
39+ "PermissionHandler is currently only supported on Android, iOS, "
40+ "Windows, and Web platforms."
4141 )
4242
4343 async def get_status_async (
@@ -57,28 +57,34 @@ async def get_status_async(
5757 TimeoutError: If the request times out.
5858 """
5959 status = await self ._invoke_method_async (
60- "get_status" , {"permission" : permission }, timeout = timeout
60+ method_name = "get_status" ,
61+ arguments = {"permission" : permission },
62+ timeout = timeout ,
6163 )
6264 return PermissionStatus (status ) if status is not None else None
6365
6466 async def request_async (
6567 self , permission : Permission , timeout : int = 60
6668 ) -> Optional [PermissionStatus ]:
6769 """
68- Request the user for access to the `permission` if access hasn't already been granted access before.
70+ Request the user for access to the `permission` if access hasn't already been
71+ granted access before.
6972
7073 Args:
7174 permission: The `Permission` to request.
7275 timeout: The maximum amount of time (in seconds) to wait for a response.
7376
7477 Returns:
75- The new `PermissionStatus` after the request, or `None` if the request was not successful.
78+ The new `PermissionStatus` after the request, or `None` if the request
79+ was not successful.
7680
7781 Raises:
7882 TimeoutError: If the request times out.
7983 """
8084 r = await self ._invoke_method_async (
81- "request" , {"permission" : permission }, timeout = timeout
85+ method_name = "request" ,
86+ arguments = {"permission" : permission },
87+ timeout = timeout ,
8288 )
8389 return PermissionStatus (r ) if r is not None else None
8490
@@ -95,4 +101,7 @@ async def open_app_settings_async(self, timeout: int = 10) -> bool:
95101 Raises:
96102 TimeoutError: If the request times out.
97103 """
98- return await self ._invoke_method_async ("open_app_settings" , timeout = timeout )
104+ return await self ._invoke_method_async (
105+ method_name = "open_app_settings" ,
106+ timeout = timeout ,
107+ )
0 commit comments