Skip to content

Commit 1bec705

Browse files
committed
Consolidate example scripts and tweak examples
Remove standalone example modules and consolidate examples into their main.py counterparts. Deleted legacy single-file examples: sdk/python/examples/controls/map/multi_layers.py, sdk/python/examples/controls/reorderable_drag_handle/basic.py, and sdk/python/examples/controls/reorderable_list_view/horizontal_and_vertical.py. Updated corresponding main.py files to: use the memomaps tile URL for the map example, add a clarifying comment in on_reorder handlers, and adjust the horizontal/vertical reorderable list layout formatting. These changes clean up duplicate files and clarify reorder behavior in the examples.
1 parent 3fe8aad commit 1bec705

6 files changed

Lines changed: 5 additions & 218 deletions

File tree

sdk/python/examples/controls/map/multi_layers.py

Lines changed: 0 additions & 132 deletions
This file was deleted.

sdk/python/examples/controls/map/multi_layers/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def handle_tap(e: ftm.MapTapEvent):
5050
on_event=print,
5151
layers=[
5252
ftm.TileLayer(
53-
url_template="https://tile.openstreetmap.org/{z}/{x}/{y}.png",
53+
url_template="https://tile.memomaps.de/tilegen/{z}/{x}/{y}.png",
5454
on_image_error=lambda e: print("TileLayer Error"),
5555
),
5656
ftm.RichAttribution(
@@ -145,7 +145,7 @@ def handle_tap(e: ftm.MapTapEvent):
145145
),
146146
],
147147
),
148-
),
148+
)
149149
)
150150

151151

sdk/python/examples/controls/reorderable_drag_handle/basic.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

sdk/python/examples/controls/reorderable_drag_handle/basic/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
def main(page: ft.Page):
55
def on_reorder(e: ft.OnReorderEvent):
6+
# Reorder controls list to match the UI change
67
e.control.controls.insert(e.new_index, e.control.controls.pop(e.old_index))
78

89
page.add(

sdk/python/examples/controls/reorderable_list_view/horizontal_and_vertical.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

sdk/python/examples/controls/reorderable_list_view/horizontal_and_vertical/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def main(page: ft.Page):
88
)
99

1010
def handle_reorder(e: ft.OnReorderEvent):
11+
# Reorder controls list to match the UI change
1112
e.control.controls.insert(e.new_index, e.control.controls.pop(e.old_index))
1213

1314
def get_color(i):
@@ -17,8 +18,7 @@ def get_color(i):
1718
ft.SafeArea(
1819
expand=True,
1920
content=ft.Column(
20-
controls=[
21-
# horizontal
21+
[ # horizontal
2222
ft.ReorderableListView(
2323
expand=True,
2424
horizontal=True,

0 commit comments

Comments
 (0)