Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3b92c3d
docs: inject example section headings dynamically from pyproject.toml
InesaFitsner Jun 1, 2026
1a52d27
docs: remove static example headers from subdirectory control docs
InesaFitsner Jun 1, 2026
03300f2
docs: remove static example headers from types/ and services/ docs
InesaFitsner Jun 1, 2026
b3211fe
docs: inject example descriptions from pyproject.toml, fix duplicate …
InesaFitsner Jun 1, 2026
7319489
docs: move chip example descriptions to pyproject.toml, fix duplicate…
InesaFitsner Jun 1, 2026
e01161d
docs: move column scroll example descriptions to pyproject.toml
InesaFitsner Jun 1, 2026
c32982f
docs(container): rename nested theme example titles to be meaningful
InesaFitsner Jun 1, 2026
6c0f29e
docs(cupertinodialogaction): replace 'see there' link with inline exa…
InesaFitsner Jun 1, 2026
180002a
docs(datatable): move example descriptions to pyproject.toml
InesaFitsner Jun 1, 2026
d732808
docs: inject DataTable examples into DataCell, DataRow, DataColumn pages
InesaFitsner Jun 1, 2026
ee14273
docs(dismissible): add static heading+description in md (hybrid appro…
InesaFitsner Jun 1, 2026
9d31fcc
refactor(docs): replace hasPrecedingH3 heuristic with explicit displa…
InesaFitsner Jun 2, 2026
323bdda
Remove examples and extra heading in docs
InesaFitsner Jun 2, 2026
6249a20
docs(drag): inject titles from metadata; restructure DragTarget page
InesaFitsner Jun 2, 2026
4af63c3
docs(expansionpanellist): move Scrolling title+description to pyproje…
InesaFitsner Jun 2, 2026
fa29e53
docs(gesturedetector): move Draggable containers title+description to…
InesaFitsner Jun 2, 2026
394400c
docs(image): move gapless playback title+description to pyproject.tom…
InesaFitsner Jun 2, 2026
4c06e90
docs(navigationbar): inject Adaptive Navigation title+description fro…
InesaFitsner Jun 2, 2026
f448e5c
docs(navigationdrawer): remove static Adaptive navigation header, inj…
InesaFitsner Jun 2, 2026
497ea24
docs(navigationrail): remove static Adaptive navigation header, injec…
InesaFitsner Jun 2, 2026
f9f5c50
Update outlinediconbutton.md
InesaFitsner Jun 2, 2026
5b11397
docs(page): inject Mobile device orientation title+description from m…
InesaFitsner Jun 2, 2026
97aa97d
docs(page): inject Window hidden on start title+description from meta…
InesaFitsner Jun 2, 2026
74fc40c
Update RadioGroup docstring and docs
InesaFitsner Jun 2, 2026
03550af
docs(reorderablelistview): replace 'see this' with inline CodeExample…
InesaFitsner Jun 2, 2026
6d33d37
docs(router): inject all example titles+descriptions from metadata
InesaFitsner Jun 2, 2026
c70edb6
docs(video): inject all titles+descriptions from metadata; extend plu…
InesaFitsner Jun 2, 2026
db7df7f
docs(webview): rename example title to "WebView"
InesaFitsner Jun 2, 2026
b0094c2
docs: remove static ### headers in layoutcontrol and responsiverow, i…
InesaFitsner Jun 2, 2026
50d0d0a
chore: delete obsolete update_example_headers.py script
InesaFitsner Jun 2, 2026
dd8143f
refactor: rename metadata field description → docs_intro
InesaFitsner Jun 2, 2026
9bb2bc9
refactor: move displayTitle opt-out from pyproject.toml to <CodeExamp…
InesaFitsner Jun 2, 2026
e1432dc
fix: correct broken scroll_to link in programmatic_scroll docs_intro
InesaFitsner Jun 2, 2026
d0f3a89
fix: add .md extension to NavigationRail link in featured_views docs_…
InesaFitsner Jun 3, 2026
924a7f1
fix: correct NavigationRail link in featured_views docs_intro (folder…
InesaFitsner Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Navigation/Router"]

[tool.flet.metadata]
title = "Featured views"
title = "Managed views — full app with NavigationRail"
docs_intro = "Complete app with [NavigationRail](navigationrail/index.md), stacked project views, and tabbed settings — all using `manage_views=True`."
controls = ["View", "AppBar", "Column", "Row", "Container", "Button", "Switch", "TextField", "Router", "Route"]
layout_pattern = "page-navigation"
complexity = "intermediate"
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/examples/apps/router/modal_routes/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ categories = ["Navigation/Router"]

[tool.flet.metadata]
title = "Modal routes"
docs_intro = """
Routes marked `modal=True` are rendered as a fullscreen-dialog overlay on top of the previous (non-modal) location's view stack. A *global* modal is declared at the top level (the URL works from anywhere); a *local* modal is declared as a child of a non-modal parent (the URL embeds the parent's segment, so deep-link works without any state)."""
controls = ["SafeArea", "Column", "Button", "Text", "TextField", "AppBar", "View", "Router", "Route"]
layout_pattern = "page-navigation"
complexity = "intermediate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Navigation/Router"]

[tool.flet.metadata]
title = "Nested outlet views"
title = "Managed views — shared layout with outlet"
docs_intro = "A layout route with `outlet=True` wraps child routes in a shared [View](../controls/view.md). Leaf components return regular controls; the layout provides the View."
controls = ["View", "AppBar", "Column", "Container", "Button", "Text", "Router", "Route"]
layout_pattern = "page-navigation"
complexity = "intermediate"
Expand Down
3 changes: 2 additions & 1 deletion sdk/python/examples/apps/router/nested_routes/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Navigation/Router"]

[tool.flet.metadata]
title = "Nested routes"
title = "Managed views — nested routes"
docs_intro = "Each route component returns a [View](../controls/view.md) with its own [AppBar](../controls/appbar.md). Navigating deeper pushes views onto the stack; swipe-back and AppBar back button pop them."
controls = ["SafeArea", "Column", "Row", "Button", "Text", "Router", "Route"]
layout_pattern = "page-navigation"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Navigation/Router"]

[tool.flet.metadata]
title = "Recursive routes"
docs_intro = "A route marked `recursive=True` can match itself as its own descendant — one View is emitted per consumed URL segment. Use this for tree-shaped URLs with unbounded depth (e.g. a file browser at `/folder/a/b/c`)."
controls = ["SafeArea", "Column", "Button", "Text", "TextField", "AppBar", "View", "Router", "Route"]
layout_pattern = "page-navigation"
complexity = "intermediate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/Column"]

[tool.flet.metadata]
title = "Column infinite scrolling"
title = "Infinite scrolling"
docs_intro = "This example demonstrates adding of list items on-the-fly, as user scroll to the bottom, creating the illusion of infinite list:"
controls = ["Container", "Column", "Text"]
layout_pattern = "infinite-list"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/Column"]

[tool.flet.metadata]
title = "Column programmatic scroll"
title = "Scrolling programmatically"
docs_intro = "This example shows how to use [`scroll_to()`](scrollablecontrol.md#flet.ScrollableControl.scroll_to) to programmatically scroll a column:"
controls = ["Container", "Column", "Row", "Button", "Text"]
layout_pattern = "control-panel"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/Container"]

[tool.flet.metadata]
title = "Nested themes 1"
title = "Inherited and overridden theme"
controls = ["SafeArea", "Column", "Container", "Button"]
layout_pattern = "single-panel"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/Container"]

[tool.flet.metadata]
title = "Nested themes 2"
title = "Page, dark and light themes"
controls = ["SafeArea", "Column", "Row", "Container", "Button", "TextButton", "Text"]
layout_pattern = "stacked-sections"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/Container"]

[tool.flet.metadata]
title = "Nested themes 3"
title = "Theme mode toggle"
controls = ["SafeArea", "Column", "Row", "Container", "Button", "Switch"]
layout_pattern = "stacked-sections"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/Dismissible"]

[tool.flet.metadata]
title = "Remove on dismiss declarative"
title = "Remove `Dismissible` `on_dismiss` inside component"
controls = ["SafeArea", "ListView", "Dismissible", "ListTile"]
layout_pattern = "list-detail"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ categories = ["Utility/GestureDetector"]

[tool.flet.metadata]
title = "Draggable containers"
docs_intro = """
The following example demonstrates how a control can be freely dragged inside a Stack.

The sample also shows that GestureDetector can have a child control (blue container) as well as be nested inside another control (yellow container) giving the same results."""
controls = ["SafeArea", "Stack", "Container", "GestureDetector"]
layout_pattern = "canvas"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ categories = ["Displays/Image"]

[tool.flet.metadata]
title = "Gapless playback when changing image sources"
docs_intro = """
This example updates both images to a new network URL on each click. With [`gapless_playback`](image.md#flet.Image.gapless_playback) set to `True`, the previous frame remains visible while the next image loads. With [`gapless_playback`](image.md#flet.Image.gapless_playback) set to `False`, the image area can briefly be empty, causing a flicker/blink effect."""
controls = ["SafeArea", "Column", "Row", "Container", "Text", "Image", "FilledButton", "AppBar"]
layout_pattern = "comparison"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Utility/Page"]

[tool.flet.metadata]
title = "Device orientation"
title = "Mobile device orientation configuration"
docs_intro = "Shows how to lock your app to specific device orientations (e.g., portrait up, landscape right) and listen for orientation changes on mobile devices."
controls = ["SafeArea", "AppBar", "Text", "Column", "Checkbox", "Page"]
layout_pattern = "single-panel"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ categories = ["Pages/Page"]

[tool.flet.metadata]
title = "Window hidden on start"
docs_intro = """
A Flet desktop app (Windows, macOS, or Linux) can start with its window hidden. This lets your app perform initial setup (for example, add content, resize or position the window) before showing it to the user.
In the example below, the window is resized and centered before becoming visible:"""
controls = ["SafeArea", "Column", "Text"]
layout_pattern = "single-panel"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ categories = ["Input/Chip"]

[tool.flet.metadata]
title = "Assist chips"
docs_intro = """
Assist chips are chips with [`leading`](chip.md#flet.Chip.leading) icon and [`on_click`](chip.md#flet.Chip.on_click) event specified.

They represent smart or automated actions that appear dynamically and contextually in a UI.

An alternative to assist chips are buttons, which should appear persistently and consistently."""
controls = ["SafeArea", "Row", "Chip", "Icon", "Text"]
layout_pattern = "inline-actions"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ categories = ["Input/Chip"]

[tool.flet.metadata]
title = "Filter chips"
docs_intro = """
Filter chips are chips with [`on_select`](chip.md#flet.Chip.on_select) event specified.
They use tags or descriptive words provided in the [`label`](chip.md#flet.Chip.label) to filter content. They can be a good alternative to switches or checkboxes."""
controls = ["SafeArea", "Column", "Row", "Chip", "Icon", "Text"]
layout_pattern = "filter-bar"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Layout/DataTable"]

[tool.flet.metadata]
title = "Adaptive row heights"
docs_intro = "Setting [`data_row_max_height`](index.md#flet.DataTable.data_row_max_height) to `float('inf')` (infinity) will cause the `DataTable` to let each individual row adapt its height to its respective content, instead of all rows having the same height."
controls = ["SafeArea", "DataTable", "DataColumn", "DataRow", "DataCell"]
layout_pattern = "table-view"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/DataTable"]

[tool.flet.metadata]
title = "Sortable and selectable"
title = "Sortable columns and selectable rows"
docs_intro = "This example demonstrates row selection (including select-all), sortable string and numeric columns, and stable selection across sorts and refreshes."
controls = ["SafeArea", "DataTable", "DataColumn", "DataRow", "DataCell", "Text"]
layout_pattern = "table-view"
complexity = "intermediate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/DataTable"]

[tool.flet.metadata]
title = "Spacing"
title = "Horizontal margin and column spacing"
docs_intro = "Use [`horizontal_margin`](index.md#flet.DataTable.horizontal_margin) to control the left and right edge spacing of the first and last columns. Use [`column_spacing`](index.md#flet.DataTable.column_spacing) to control spacing between columns."
controls = ["SafeArea", "Column", "DataTable", "DataColumn", "DataRow", "DataCell", "Slider", "FilledButton", "OutlinedButton", "Container", "Text", "AppBar"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Layout/ExpansionPanelList"]

[tool.flet.metadata]
title = "Scrollable"
title = "Scrolling"
docs_intro = "`ExpansionPanelList` supports scrolling through its [`scroll`](expansionpanellist.md) property."
controls = ["SafeArea", "ExpansionPanelList", "ExpansionPanel", "ListTile", "IconButton", "Text"]
layout_pattern = "list-detail"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Navigation/NavigationDrawer"]

[tool.flet.metadata]
title = "Adaptive Navigation"
docs_intro = "This example switches between a `NavigationBar` on narrow layouts and a [`NavigationRail`](../navigationrail/index.md) with an end [`NavigationDrawer`](../navigationdrawer/index.md) on wider layouts."
controls = ["NavigationDrawer", "NavigationDrawerDestination", "NavigationRail", "NavigationRailDestination", "NavigationBar", "NavigationBarDestination", "Button", "SafeArea", "Container", "Row", "Column", "VerticalDivider", "Text", "Page"]
layout_pattern = "adaptive-navigation"
complexity = "intermediate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Input/Reorderable"]

[tool.flet.metadata]
title = "ReorderableDragHandle"
title = "Custom drag handle"
controls = ["ReorderableListView", "ReorderableDragHandle", "ListTile", "SafeArea"]
layout_pattern = "draggable-list"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Charts/MatplotlibChart"]

[tool.flet.metadata]
title = "Bar Chart"
docs_intro = "Based on an official [Matplotlib example](https://matplotlib.org/stable/gallery/lines_bars_and_markers/bar_colors.html#sphx-glr-gallery-lines-bars-and-markers-bar-colors-py)."
controls = ["SafeArea", "MatplotlibChart"]
layout_pattern = "single-chart"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Charts/MatplotlibChart"]

[tool.flet.metadata]
title = "Toolbar"
docs_intro = "Based on an official [Matplotlib example](https://matplotlib.org/stable/gallery/lines_bars_and_markers/cohere.html#sphx-glr-gallery-lines-bars-and-markers-cohere-py)."
controls = ["SafeArea", "MatplotlibChart"]
layout_pattern = "single-chart"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Charts/PlotlyChart"]

[tool.flet.metadata]
title = "Plotly line chart"
docs_intro = "Based on an official [Plotly example](https://plotly.com/python/line-charts)."
controls = ["SafeArea", "PlotlyChart"]
layout_pattern = "single-chart"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Charts/PlotlyChart"]

[tool.flet.metadata]
title = "Plotly bar chart"
docs_intro = "Based on an official [Plotly example](https://plotly.com/python/bar-charts)."
controls = ["SafeArea", "PlotlyChart"]
layout_pattern = "single-chart"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Charts/PlotlyChart"]

[tool.flet.metadata]
title = "Plotly pie chart"
docs_intro = "Based on an official [Plotly example](https://plotly.com/python/pie-charts)."
controls = ["SafeArea", "PlotlyChart"]
layout_pattern = "single-chart"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Charts/PlotlyChart"]

[tool.flet.metadata]
title = "Plotly box plot"
docs_intro = "Based on an official [Plotly example](https://plotly.com/python/box-plots)."
controls = ["SafeArea", "PlotlyChart"]
layout_pattern = "single-chart"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Button bars"
docs_intro = "Customize the [`primary_button_bar`][flet_video.MaterialDesktopVideoControls.primary_button_bar], [`top_button_bar`][flet_video.MaterialDesktopVideoControls.top_button_bar], and [`bottom_button_bar`][flet_video.MaterialDesktopVideoControls.bottom_button_bar] of [`MaterialDesktopVideoControls`][flet_video.MaterialDesktopVideoControls] with built-in and custom items."
controls = ["SafeArea", "Text", "Icon", "Video"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Controls"
docs_intro = "Switch between [`AdaptiveVideoControls`][flet_video.AdaptiveVideoControls], [`MaterialVideoControls`][flet_video.MaterialVideoControls], [`MaterialDesktopVideoControls`][flet_video.MaterialDesktopVideoControls], custom, and hidden control sets at runtime."
controls = ["SafeArea", "Column", "Row", "Button", "IconButton", "Video"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Mode-specific controls"
docs_intro = "Show different controls in normal vs. fullscreen mode by mapping each [`VideoControlsMode`][flet_video.VideoControlsMode] to its own [`controls`][flet_video.Video.controls] value."
controls = ["SafeArea", "Container", "Text", "Video"]
layout_pattern = "single-panel"
complexity = "basic"
Expand Down
1 change: 1 addition & 0 deletions sdk/python/examples/extensions/video/events/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Events"
docs_intro = "Listen for player [events](#flet_video.Video-events) like [`on_load`][flet_video.Video.on_load], [`on_complete`][flet_video.Video.on_complete], [`on_track_change`][flet_video.Video.on_track_change], etc."
controls = ["SafeArea", "Video"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Playback Controls"
docs_intro = "Drive playback programmatically with methods like [`play()`][flet_video.Video.play], [`pause()`][flet_video.Video.pause], [`stop()`][flet_video.Video.stop], [`seek()`][flet_video.Video.seek], [`next()`][flet_video.Video.next], and [`previous()`][flet_video.Video.previous], and inspect status with methods like [`is_playing()`][flet_video.Video.is_playing], [`get_current_position()`][flet_video.Video.get_current_position], and [`get_duration()`][flet_video.Video.get_duration]."
controls = ["SafeArea", "Column", "Row", "Button", "Text", "Video"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Playlist"
docs_intro = "Mutate [`playlist`][flet_video.Video.playlist] directly to add, remove, or replace items, and navigate between tracks."
controls = ["SafeArea", "Column", "Row", "Button", "Video"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Video Screenshot"
docs_intro = "Shows how to capture the current video frame with [`take_screenshot()`][flet_video.Video.take_screenshot] and display it as an image."
controls = ["SafeArea", "Column", "Row", "Button", "Container", "Image", "Text", "Video"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ categories = ["Media/Video"]

[tool.flet.metadata]
title = "Subtitles"
docs_intro = "Attach a [`VideoSubtitleTrack`][flet_video.VideoSubtitleTrack] (here, raw VTT text) and customize its appearance with [`VideoSubtitleConfiguration`][flet_video.VideoSubtitleConfiguration]."
controls = ["SafeArea", "Column", "Switch", "Video"]
layout_pattern = "dashboard"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dev = ["flet-cli", "flet-desktop", "flet-web"]
categories = ["Display/WebView"]

[tool.flet.metadata]
title = "WebView example 1"
title = "WebView"
controls = ["SafeArea", "WebView"]
layout_pattern = "single-panel"
complexity = "basic"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class RadioGroup(Control):
"""
The content of the RadioGroup.

Typically a list of `Radio` controls nested in a container control, e.g. `Column`,
`Row`.
Typically a list of :class:`~flet.Radio` controls nested in a container control,
e.g. `Column`, `Row`.

Raises:
ValueError: If :attr:`content` is not visible.
Expand Down
21 changes: 16 additions & 5 deletions tools/crocodocs/src/crocodocs/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,19 @@ def _generate_code_examples(examples_root: Path, output_path: Path) -> int:
return len(mapping)


def _read_pyproject(pyproject_path: Path) -> dict[str, Any]:
try:
return tomllib.loads(pyproject_path.read_text(encoding="utf-8"))
except (OSError, ValueError):
return {}


def _example_web_supported(pyproject_path: Path) -> bool:
"""Return True when the example at pyproject_path supports the web platform.

Web is supported when [tool.flet].platforms is absent, empty, or contains "web".
"""
try:
data = tomllib.loads(pyproject_path.read_text(encoding="utf-8"))
except (OSError, ValueError):
return True
data = _read_pyproject(pyproject_path)
platforms = data.get("tool", {}).get("flet", {}).get("platforms")
if not platforms:
return True
Expand All @@ -183,7 +187,14 @@ def _generate_examples_metadata(examples_root: Path, output_path: Path) -> int:
if example_dir == examples_root:
continue
relative = example_dir.relative_to(examples_root).as_posix()
mapping[relative] = {"webSupported": _example_web_supported(pyproject_path)}
data = _read_pyproject(pyproject_path)
meta: dict[str, Any] = {"webSupported": _example_web_supported(pyproject_path)}
flet_metadata = data.get("tool", {}).get("flet", {}).get("metadata", {})
if title := flet_metadata.get("title"):
meta["title"] = title
if docs_intro := flet_metadata.get("docs_intro"):
meta["docs_intro"] = docs_intro
mapping[relative] = meta

output_path.write_text(
json.dumps(mapping, indent=2, sort_keys=True), encoding="utf-8"
Expand Down
Loading
Loading