Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9280b0f
initial commit
OwenMcDonnell Nov 26, 2025
c22c062
Refactor: wrap main function call in `if __name__ == '__main__'` for …
ndonkoHenri Nov 26, 2025
112f2d7
Fix: update ListView properties for better layout and scrolling behavior
ndonkoHenri Nov 26, 2025
847be5c
Add: create __init__.py for package initialization
ndonkoHenri Nov 26, 2025
ae06c5c
test
ndonkoHenri Nov 26, 2025
b3aece8
remove logging
ndonkoHenri Nov 26, 2025
dfb62be
Add search functionality to filter control examples in the main page
ndonkoHenri Nov 27, 2025
9dfbc7e
Add iframe rendering functionality and update checkbox height
ndonkoHenri Nov 27, 2025
781fdc0
Fix routeUrlStrategy assignment to handle different types
ndonkoHenri Nov 27, 2025
540e8d0
remove media
ndonkoHenri Nov 27, 2025
b17238d
remove media
ndonkoHenri Nov 27, 2025
3073061
base app
ndonkoHenri Nov 27, 2025
2a56caa
Update base URL for examples gallery in initialization
ndonkoHenri Nov 27, 2025
8c8307c
poc
ndonkoHenri Nov 27, 2025
a4bd291
more demo
ndonkoHenri Nov 27, 2025
a37decf
Update project description and enhance demo route handling
ndonkoHenri Nov 27, 2025
9961d55
Refactor project directory resolution and enhance asset handling in p…
ndonkoHenri Nov 27, 2025
3829555
Merge remote-tracking branch 'origin/embed-examples' into embed-examples
ndonkoHenri Nov 27, 2025
86fae46
Enhance _latest_mtime function to ignore specified directories and im…
ndonkoHenri Nov 27, 2025
000e201
disable ci
ndonkoHenri Nov 27, 2025
54fbe72
Add flet-web dependency to pyproject.toml
ndonkoHenri Nov 27, 2025
30407ae
Add pip availability check and bootstrap in examples_gallery.py
ndonkoHenri Nov 27, 2025
a238099
docs workflow
ndonkoHenri Nov 27, 2025
a962782
Update flet and flet-web dependencies to allow for newer versions
ndonkoHenri Nov 27, 2025
21d6805
update docs ci
ndonkoHenri Nov 27, 2025
b89018c
Add web client management for publishing in examples_gallery.py
ndonkoHenri Nov 28, 2025
af2c9ec
Add Flet version resolution and fallback mechanism in examples_galler…
ndonkoHenri Nov 28, 2025
2ff9078
Refactor version resolution and fallback logic in examples_gallery.py
ndonkoHenri Nov 28, 2025
3002d98
delete src/controls
ndonkoHenri Nov 28, 2025
e6890a7
Add staging directory for bundling external examples in publishing
ndonkoHenri Nov 28, 2025
ffbeb45
handle mkdocs strict mode
ndonkoHenri Nov 29, 2025
07b2cbc
improve logger
ndonkoHenri Nov 29, 2025
85c7076
Update examples to use code_and_demo macro
ndonkoHenri Nov 29, 2025
cf92fdd
Remove flet-web dependency from docs group
ndonkoHenri Nov 29, 2025
903ecf8
ci: on
ndonkoHenri Nov 29, 2025
c0e6ae8
update types docs
ndonkoHenri Nov 29, 2025
670a6ef
update types examples
ndonkoHenri Nov 29, 2025
80d9474
improve file picker docs
ndonkoHenri Nov 29, 2025
3c43e03
restore icons
ndonkoHenri Nov 29, 2025
12a4e55
fixes
ndonkoHenri Nov 29, 2025
5fbce1a
Merge branch 'main' into embed-examples-publish
ndonkoHenri Nov 29, 2025
8970871
add flet-web dependency to docs group
ndonkoHenri Nov 29, 2025
fd18163
update demo width in examples to 100%
ndonkoHenri Nov 30, 2025
f36145d
update flutter_lints dependency to version 6.0.0
ndonkoHenri Nov 30, 2025
5af8f37
harmonize SDK and Flutter version constraints in pubspec.yaml to ">=3…
ndonkoHenri Nov 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build docs

on:
workflow_dispatch:

jobs:
deploy:
name: Build Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v6

- name: Build docs
working-directory: sdk/python/packages/flet
run: |
uv run --group docs mkdocs build
8 changes: 4 additions & 4 deletions client/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
version: "6.0.0"
flutter_localizations:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -626,10 +626,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "6.0.0"
lists:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: '>=3.0.0 <4.0.0'
sdk: ">=3.8.0 <4.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand Down Expand Up @@ -92,7 +92,7 @@ dev_dependencies:
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^1.0.0
flutter_lints: ^6.0.0

# Docs: https://pub.dev/packages/flutter_launcher_icons
flutter_launcher_icons: "^0.14.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/flet/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ platforms:
windows:

environment:
sdk: '>=3.0.0 <4.0.0'
sdk: ">=3.8.0 <4.0.0"

dependencies:
flutter:
Expand Down Expand Up @@ -49,7 +49,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.1
flutter_lints: ^6.0.0

flutter:

Expand Down
Empty file.
6 changes: 3 additions & 3 deletions sdk/python/examples/controls/ads/example_1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import flet_ads as fta

import flet as ft
import flet_ads as fta


def main(page: ft.Page):
Expand Down Expand Up @@ -77,4 +76,5 @@ def get_new_banner_ad() -> ft.Container:
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ def animate(e: ft.Event[ft.Button]):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ def rotate(e):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Empty file.
Binary file not shown.
Binary file removed sdk/python/examples/controls/app_bar/media/index.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ def toggle_material(e: ft.Event[ft.IconButton]):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Empty file.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/audio/declarative_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ async def resume():
]


ft.run(lambda page: page.render(App))
if __name__ == "__main__":
ft.run(lambda page: page.render(App))
27 changes: 16 additions & 11 deletions sdk/python/examples/controls/audio/example_1.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import flet_audio as fta

import flet as ft
import flet_audio as fta


def main(page: ft.Page):
url = "https://github.com/mdn/webaudio-examples/blob/main/audio-analyser/viper.mp3?raw=true"
url = "https://luan.xyz/files/audio/ambient_c_motion.mp3"

def log(message: str):
page.show_dialog(ft.SnackBar(content=message))
print(message)

async def play():
await audio.play()
Expand All @@ -20,6 +23,7 @@ async def release():

def set_volume(value: float):
audio.volume += value
log(f"Volume: {audio.volume}")

def set_balance(value: float):
audio.balance += value
Expand All @@ -29,22 +33,22 @@ async def seek_2s():

async def get_duration():
duration = await audio.get_duration()
print("Duration:", duration)
log(f"Duration: {duration}")

async def on_get_current_position():
position = await audio.get_current_position()
print("Current position:", position)
log(f"Current position: {position}")

audio = fta.Audio(
src=url,
autoplay=False,
volume=1,
balance=0,
on_loaded=lambda _: print("Loaded"),
on_duration_change=lambda e: print("Duration changed:", e.duration),
on_position_change=lambda e: print("Position changed:", e.position),
on_state_change=lambda e: print("State changed:", e.state),
on_seek_complete=lambda _: print("Seek complete"),
on_loaded=lambda _: log("Loaded"),
on_duration_change=lambda e: print(f"Duration changed: {e.duration}"),
on_position_change=lambda e: print(f"Position changed: {e.position}"),
on_state_change=lambda e: log(f"State changed: {e.state}"),
on_seek_complete=lambda _: log("Seek complete"),
)

page.add(
Expand All @@ -70,4 +74,5 @@ async def on_get_current_position():
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Empty file.
12 changes: 4 additions & 8 deletions sdk/python/examples/controls/audio_recorder/example_1.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import logging

import flet_audio_recorder as far

import flet as ft

logging.basicConfig(level=logging.DEBUG)
import flet_audio_recorder as far


def main(page: ft.Page):
Expand Down Expand Up @@ -43,7 +38,7 @@ async def handle_pause(e: ft.Event[ft.Button]):
await recorder.pause_recording()

async def handle_resume(e: ft.Event[ft.Button]):
print(f"isPaused: {await recorder.is_paused()}")
print(f"is_paused: {await recorder.is_paused()}")
if await recorder.is_paused():
await recorder.resume_recording()

Expand All @@ -69,4 +64,5 @@ async def handle_audio_encoder_test(e: ft.Event[ft.Button]):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Empty file.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/auto_complete/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ def handle_select(e: ft.AutoCompleteSelectEvent):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Empty file.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/autofill_group/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Empty file.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/banner/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ def handle_banner_close(e: ft.Event[ft.TextButton]):
page.add(ft.Button("Show Banner", on_click=lambda e: page.show_dialog(banner)))


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file removed sdk/python/examples/controls/banner/media/basic.gif
Binary file not shown.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/bursting_flet.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ def animate(e: ft.Event[ft.Button]):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Binary file removed sdk/python/examples/controls/button/media/basic.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed sdk/python/examples/controls/button/media/index.png
Binary file not shown.
Empty file.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/bezier_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ def main(page: ft.Page):
page.add(cp)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/brush.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ async def save_image():
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/brush_on_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ def handle_pan_update(e: ft.DragUpdateEvent):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/dash_strokes.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ def App():
)


ft.run(lambda page: page.render(App))
if __name__ == "__main__":
ft.run(lambda page: page.render(App))
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/flet_logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed sdk/python/examples/controls/canvas/media/text.png
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ def paint_resize(e: cv.CanvasResizeEvent):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/smiling_face.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/canvas/triangles.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Empty file.
Empty file.
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/charts/bar_chart/example_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ def main(page: ft.Page):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
6 changes: 3 additions & 3 deletions sdk/python/examples/controls/charts/bar_chart/example_2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import flet_charts as fch

import flet as ft
import flet_charts as fch


class CustomRod(fch.BarChartRod):
Expand Down Expand Up @@ -70,4 +69,5 @@ def on_chart_event(e: fch.BarChartEvent):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,5 @@ def handle_event(e: fch.CandlestickChartEvent):
)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ def App():
)


ft.run(lambda page: page.render(App))
if __name__ == "__main__":
ft.run(lambda page: page.render(App))
6 changes: 3 additions & 3 deletions sdk/python/examples/controls/charts/line_chart/example_1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import flet_charts as fch

import flet as ft
import flet_charts as fch


class State:
Expand Down Expand Up @@ -203,4 +202,5 @@ def toggle_data(e: ft.Event[ft.IconButton]):
page.add(ft.IconButton(ft.Icons.REFRESH, on_click=toggle_data), chart)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
3 changes: 2 additions & 1 deletion sdk/python/examples/controls/charts/line_chart/example_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,5 @@ def toggle_data(e: ft.Event[ft.ElevatedButton]):
page.add(ft.Button("avg", on_click=toggle_data), chart)


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Binary file not shown.
Binary file not shown.
7 changes: 2 additions & 5 deletions sdk/python/examples/controls/charts/matplotlib_chart/3d.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import logging

import matplotlib.pyplot as plt
import numpy as np

import flet as ft
import flet_charts

logging.basicConfig(level=logging.INFO)


def main(page: ft.Page):
plt.style.use("_mpl-gallery")
Expand All @@ -33,4 +29,5 @@ def main(page: ft.Page):
page.add(flet_charts.MatplotlibChartWithToolbar(figure=fig))


ft.run(main)
if __name__ == "__main__":
ft.run(main)
Empty file.
Loading
Loading