Skip to content

Commit 2060d43

Browse files
committed
Squashed commit of the following:
commit 69046cee1a74187598572e3285886595d51dd52d Author: Feodor Fitsner <[email protected]> Date: Tue Oct 24 12:02:55 2023 -0700 Handle all embedded platforms
1 parent 0a16c0f commit 2060d43

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

sdk/python/packages/flet-runtime/src/flet_runtime/app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
get_package_bin_dir,
3434
get_package_web_dir,
3535
get_platform,
36+
is_embedded,
3637
is_linux,
3738
is_linux_server,
3839
is_macos,
39-
is_mobile,
4040
is_windows,
4141
open_in_browser,
4242
safe_tar_extractall,
@@ -172,7 +172,7 @@ def exit_gracefully(signum, frame):
172172
or view == AppView.FLET_APP_WEB
173173
)
174174
and not is_linux_server()
175-
and not is_mobile()
175+
and not is_embedded()
176176
and url_prefix is None
177177
):
178178
fvp, pid_file = open_flet_view(
@@ -261,7 +261,7 @@ def exit_gracefully(signum, frame):
261261
or view == AppView.FLET_APP_WEB
262262
)
263263
and not is_linux_server()
264-
and not is_mobile()
264+
and not is_embedded()
265265
and url_prefix is None
266266
):
267267
fvp, pid_file = await open_flet_view_async(
@@ -323,7 +323,7 @@ def __connect_internal_sync(
323323
assets_dir = env_assets_dir
324324

325325
is_socket_server = server is None and (
326-
is_mobile() or view == AppView.FLET_APP or view == AppView.FLET_APP_HIDDEN
326+
is_embedded() or view == AppView.FLET_APP or view == AppView.FLET_APP_HIDDEN
327327
)
328328

329329
if not is_socket_server:
@@ -410,7 +410,7 @@ async def __connect_internal_async(
410410
assets_dir = env_assets_dir
411411

412412
is_socket_server = server is None and (
413-
is_mobile() or view == AppView.FLET_APP or view == AppView.FLET_APP_HIDDEN
413+
is_embedded() or view == AppView.FLET_APP or view == AppView.FLET_APP_HIDDEN
414414
)
415415
if not is_socket_server:
416416
server = __start_flet_server(

sdk/python/packages/flet-runtime/src/flet_runtime/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010

1111

1212
def is_ios():
13-
return os.getenv("FLET_PLATFORM") == "iOS"
13+
return os.getenv("FLET_PLATFORM") == "ios"
1414

1515

1616
def is_android():
17-
return os.getenv("FLET_PLATFORM") == "Android"
17+
return os.getenv("FLET_PLATFORM") == "android"
18+
19+
20+
def is_embedded():
21+
return os.getenv("FLET_PLATFORM") is not None
1822

1923

2024
def is_mobile():

0 commit comments

Comments
 (0)