Skip to content

Commit 3ef7f29

Browse files
committed
Update iframe base URL to fly.io and add flet version in appbar
1 parent 571000d commit 3ef7f29

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

sdk/python/packages/flet/docs/apps/examples-gallery/src/main.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Callable, Union
77

88
import flet as ft
9+
import flet.version
910

1011
Runner = Callable[[ft.Page], Union[None, Awaitable[None]]]
1112

@@ -37,8 +38,8 @@ def discover_examples():
3738
for path in sorted(EXAMPLES_ROOT.rglob("*.py")):
3839
# skip files/folders not supported on pyodide or otherwise excluded
3940
non_pyodide = {"matplotlib_chart"}
40-
exclude = (
41-
{"media", "ads"} | (non_pyodide if sys.platform == "emscripten" else set())
41+
exclude = {"media", "ads"} | (
42+
non_pyodide if sys.platform == "emscripten" else set()
4243
)
4344

4445
if path.name.startswith("_") or any(
@@ -127,10 +128,16 @@ def filter_controls(query: str) -> dict[str, list[dict[str, object]]]:
127128

128129
def render_home():
129130
page.appbar = ft.AppBar(
130-
title=ft.Text("Flet examples", weight=ft.FontWeight.W_600),
131+
title=ft.Text("Flet Examples Gallery", weight=ft.FontWeight.W_600),
131132
center_title=False,
132133
bgcolor=ft.Colors.SURFACE_CONTAINER_HIGHEST,
133134
automatically_imply_leading=False,
135+
actions=[
136+
ft.Container(
137+
padding=10,
138+
content=ft.Text(f"Flet version: {ft.version.version}", size=12),
139+
)
140+
],
134141
)
135142
page.clean()
136143

@@ -212,6 +219,9 @@ def update_controls():
212219

213220
def reset_page():
214221
page.appbar = None
222+
page.bottom_appbar = None
223+
page.drawer = None
224+
page.end_drawer = None
215225
page.clean()
216226
page.overlay.clear()
217227
page.pop_dialog()

sdk/python/packages/flet/docs/extras/macros/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def demo(
188188

189189
return render_iframe(
190190
route=route,
191-
base="/apps/examples-gallery/dist/#/",
191+
base="https://flet-examples-gallery.fly.dev/",
192192
width=width,
193193
height=height,
194194
title=title,
@@ -217,12 +217,12 @@ def iframe(
217217
src=None,
218218
*,
219219
route=None,
220-
base="/apps/examples-gallery/dist/#/",
221-
width="100%",
222-
height="480",
223-
title=None,
224-
allow=None,
225-
loading="lazy",
220+
base: Optional[str] = None,
221+
width: str = "100%",
222+
height: str = "480",
223+
title: Optional[str] = None,
224+
allow: Optional[str] = None,
225+
loading: str = "lazy",
226226
):
227227
"""Render an iframe for a route or external source."""
228228
return render_iframe(

sdk/python/packages/flet/docs/extras/macros/iframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Default iframe base can be overridden for local dev via FLET_IFRAME_BASE.
66
# Points to the published examples gallery bundled with the docs.
77
DEFAULT_IFRAME_BASE = os.environ.get(
8-
"FLET_IFRAME_BASE", "/apps/examples-gallery/dist/index.html#/"
8+
"FLET_IFRAME_BASE", "https://flet-examples-gallery.fly.dev/"
99
)
1010

1111

sdk/python/packages/flet/mkdocs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ plugins:
162162
- source_dir: integration_tests
163163
target_url_path: test-images
164164
include_exts: [".png", ".gif", ".svg"]
165-
- examples_gallery:
166-
src: apps/examples-gallery/src
167-
dist: apps/examples-gallery/dist
168-
base_url: apps/examples-gallery/dist
169165

170166
# Markdown Extensions
171167
markdown_extensions:

0 commit comments

Comments
 (0)