Skip to content

Commit d37a9cb

Browse files
Gallery categories (#6489)
* Add curated gallery.yaml for Flet examples Add sdk/python/examples/gallery.yaml: a curated catalog of example categories for the Flet gallery. The YAML defines a top-level categories map with metadata (_icon, _description) and nested child categories; insertion order determines display order and slugs are derived from names. Examples whose [tool.flet.gallery].categories reference missing paths will be skipped during scan. * Refactor basic counter; add editable example Update the basic counter example to a simpler UI: replace TextField-based counter with a Text widget backed by a numeric data field and a FloatingActionButton for increments; simplify layout and call ft.run(main) at module bottom. Update basic pyproject metadata (package name, description, keywords, and controls). Add a new "editable" counter example that preserves the original TextField UI with minus/plus IconButtons and its pyproject metadata. * Move basic counter to templates and update gallery Convert the existing basic counter example into a template: move main.py from apps/counter/basic to apps/templates/basic_counter, remove the old apps/counter/basic/pyproject.toml, and add a new template pyproject.toml in apps/templates/basic_counter with template-focused metadata and author placeholder. Add a comprehensive .gitignore for the new template folder. Update sdk/python/examples/gallery.yaml to include a "Templates" category. * Update example metadata and gallery categories Remove unused emoticon assets and reorganize example metadata and gallery taxonomy. Deleted three images (cry/neutral/smile). Standardized and renamed categories in many sdk/python example pyproject.toml files (e.g. CodeEditor -> Input/CodeEditor, color pickers -> Utility/Color pickers & Theming, Display/Text -> Typography/Text, various canvas/paint categories -> Displays/Shapes). Added platforms entry to plotly_chart examples. Adjusted community example category (Mind Queue -> Apps/Productivity). Updated sdk/python/examples/gallery.yaml to reflect the new category structure (added Typography and Theming, moved/removed entries, commented out several service items and added inline notes about platform/CORS/permission issues). * Add routing placeholder comment Insert a "# Routing?" comment into sdk/python/examples/gallery.yaml under the Tabs -> CupertinoNavigationBar categories as a placeholder/note to consider adding routing-related examples. This is a non-functional documentation/comment-only change. * Add mobile platforms and expose WebView in gallery Add supported platforms (macos, ios, android) to the webview example's pyproject.toml to enable mobile builds. Update sdk/python/examples/gallery.yaml to include WebView and add Router/Routing entries in the components list, cleaning up prior commented placeholders. * Reclassify examples to Navigation/Routing Update gallery categories for several Python example apps to use the new "Navigation/Routing" category instead of "Apps/Navigation" (and add it alongside "Apps/Declarative" for the declarative routing example). Affects pyproject.toml in sdk/python/examples/apps/declarative/routing_two_pages and multiple routing_navigation examples. This is a metadata-only change to improve gallery organization. * Organize Python examples gallery categories Update example metadata and gallery config to reorganize categories: - sdk/python/examples/apps/7guis/cells/pyproject.toml: move from "Apps/7GUIs" to "Featured/7GUIs". - sdk/python/examples/apps/7guis/temperature_converter/pyproject.toml: move to "Featured/7GUIs" and change secondary category to "Tools". - sdk/python/examples/apps/declarative/minesweeper/pyproject.toml and tic_tac_toe/pyproject.toml: move primary category from "Apps/Games" to top-level "Games". - sdk/python/examples/gallery.yaml: add top-level category entries (Featured, Getting Started, Tools, Games) with icons and descriptions and nest the 7GUIs group under Featured. These changes reorganize the gallery structure and example categorization for clearer grouping in the gallery UI; no functional code changes. * Reorganize gallery categories and add tutorials Refactor example categorization for the Python SDK gallery and add two tutorial examples. Many example pyproject.toml files were updated to move items out of broad "Services" into more specific categories (Accessibility, Sensors, Utility, Media, Marketing, Tools, Featured, Navigation/Routing, etc.). The sdk/python/examples/gallery.yaml was updated to reflect the new top-level sections (Games, Accessibility, Sensors, Marketing) and reorganized entries. Also add new tutorial metadata files for Calculator and Solitaire (tutorials/calculator and tutorials/solitaire_declarative/solitaire-final). These changes prepare the gallery for clearer organization and discoverability. * Use local audio assets in audio examples Add local MP3 assets and update examples to use them instead of remote URLs. Added sounds_sweet-life-luxury-chill.mp3 (declarative_1/assets) and viper.mp3 (example_1/assets), and changed main.py in both examples to reference the local filenames (e.g. "sounds_sweet-life-luxury-chill.mp3" and "viper.mp3"). This makes the examples self-contained and usable offline. * refactor: update gallery categories from "Extensions/Map" to "Displays/Map" * feat: add calculator app with custom button controls and arithmetic operations * Update examples gallery categories and entrypoints Reorganize gallery metadata and unify example entrypoints. Updated categories in many sdk/python example pyproject.toml files (add Featured tags, reclassify categories, remove redundant gallery sections for some auth examples, and adjust color picker categories). Edited sdk/python/examples/gallery.yaml to reflect category changes (add Text, Extensibility, Featured placements, remove old Typography/Theming groupings). Simplified declarative example scripts by removing standalone main() functions and using ft.run(lambda page: page.render(...)) or render_views(...) inline. Renamed apps/todo/basic package to apps-todo-classic and updated its title to "Classic To-Do"; also applied a small formatting tweak to TodoAppState.get_tasks. * Refactor example categories and update gallery metadata - Changed categories for multiple examples from "Utility/Types" to "Layout/Container" to better reflect their purpose. - Updated the title for the "Tab Alignment showcase" and related examples to align with the new categorization. - Modified the gallery.yaml to rename the "Extensibility" category to "Cookbook" for clarity on its content. * Minesweeper: Disable browser context menu on web In the App() function of the Minesweeper example, add a web-only check that schedules ft.BrowserContextMenu().disable() on mount (via ft.on_mounted and asyncio.create_task). This prevents the browser's right-click context menu from interfering with game interactions when running in a web context. * Fix Matplotlib 3D chart * Update Solitaire UI, layout and entrypoint Polish the Solitaire example UI and app entrypoint: introduce a BG_COLOR constant and apply it to page and containers, set page padding to 0, adjust Stack/container expansion to capture full area, and restyle bottom bar with padding and white text. Tweak card slot visuals (use BLACK_12 border and remove slot id text) for a cleaner look. Replace inline ft.run(lambda ...) with a main(page) function and call ft.run(main) for clearer page initialization. Also add "Featured" to the gallery categories in pyproject.toml. * Solitaire: responsive layout that scales to window width * Solitaire: size board from on_size_change instead of page.width Page width can be larger than the embedding container (e.g. FletApp), so the layout overflows. Use the board's own size_change event to drive the responsive layout instead. * Update examples gallery categories and metadata Reorganized gallery categories and updated metadata for multiple Python example projects. Changes include: consolidating 7GUIs examples under Featured/7GUIs, moving various control examples from Displays/Shapes to Displays/Canvas, renaming Utility/KeyboardListener to Utility/Keyboard, reclassifying code editor examples to Input/CodeEditor, changing ShakeDetector to Sensors/ShakeDetector, and adjusting router example title to "Router featured app (declarative)". Added a new Declarative category in sdk/python/examples/gallery.yaml and added platforms/org/company metadata to the no_frame_window example. These updates tidy the gallery taxonomy and improve example metadata for discovery. * Update example gallery categories Normalize gallery categories across Python example pyproject.toml files by removing the "Apps/*" namespace and mapping examples to top-level categories (e.g. "Declarative", "Getting Started", "Featured", "Games", "Displays/Canvas", "Navigation/Routing"). Also adjust some productivity/product mappings and add a new "Community" category to sdk/python/examples/gallery.yaml (icon: people, description: Examples contributed by the community). This standardizes the gallery taxonomy for examples. * Update example metadata and gallery categories Add/adjust gallery categories and example metadata for Python examples: add "Getting Started"/"Getting Started/Declarative" tags to several declarative and todo examples, rename example titles for clarity (Counter, Counter minimal, Routing example), and clean up sdk/python/examples/gallery.yaml category entries. Also remove route_url_strategy="hash" from the routing example's ft.run call to use the default routing behavior. * Update example pyproject platforms Adjust platforms in example pyproject.toml files to reflect supported targets. Remove "web" from ads and several sensor examples and standardize mobile-only examples to ["android", "ios"] (ads example, accelerometer, gyroscope, user_accelerometer). Add explicit platforms entries for haptic_feedback and shake_detector as ["android", "ios"]. Add multi-platform support to the battery example with ["android", "ios", "windows", "linux", "macos"]. Files modified: sdk/python/examples/extensions/ads/example_1/pyproject.toml, sdk/python/examples/services/accelerometer/basic/pyproject.toml, sdk/python/examples/services/battery/basic/pyproject.toml, sdk/python/examples/services/gyroscope/basic/pyproject.toml, sdk/python/examples/services/haptic_feedback/basic/pyproject.toml, sdk/python/examples/services/shake_detector/basic/pyproject.toml, sdk/python/examples/services/user_accelerometer/basic/pyproject.toml. * Add dashboard_declarative to Declarative category
1 parent 492881c commit d37a9cb

248 files changed

Lines changed: 992 additions & 487 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/python/examples/apps/7guis/cells/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = ["flet"]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

1313
[tool.flet.gallery]
14-
categories = ["Apps/7GUIs", "Apps/Productivity"]
14+
categories = ["Featured/7GUIs"]
1515

1616
[tool.flet.metadata]
1717
title = "Cells"

sdk/python/examples/apps/7guis/circle_drawer/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = ["flet"]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

1313
[tool.flet.gallery]
14-
categories = ["Apps/7GUIs", "Apps/Canvas"]
14+
categories = ["Featured/7GUIs", "Displays/Canvas"]
1515

1616
[tool.flet.metadata]
1717
title = "Circle drawer"

sdk/python/examples/apps/7guis/counter/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = ["flet"]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

1313
[tool.flet.gallery]
14-
categories = ["Apps/7GUIs", "Apps/Basic"]
14+
categories = ["Featured/7GUIs"]
1515

1616
[tool.flet.metadata]
1717
title = "Counter"

sdk/python/examples/apps/7guis/crud/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = ["flet"]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

1313
[tool.flet.gallery]
14-
categories = ["Apps/7GUIs", "Apps/Productivity", "Apps/Forms"]
14+
categories = ["Featured/7GUIs"]
1515

1616
[tool.flet.metadata]
1717
title = "CRUD"

sdk/python/examples/apps/7guis/flight_booker/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = ["flet"]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

1313
[tool.flet.gallery]
14-
categories = ["Apps/7GUIs", "Apps/Forms"]
14+
categories = ["Featured/7GUIs"]
1515

1616
[tool.flet.metadata]
1717
title = "Flight booker"

sdk/python/examples/apps/7guis/temperature_converter/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = ["flet"]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

1313
[tool.flet.gallery]
14-
categories = ["Apps/7GUIs", "Apps/Forms"]
14+
categories = ["Featured/7GUIs", "Tools"]
1515

1616
[tool.flet.metadata]
1717
title = "Temperature converter"

sdk/python/examples/apps/7guis/timer/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = ["flet"]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

1313
[tool.flet.gallery]
14-
categories = ["Apps/7GUIs", "Apps/Time"]
14+
categories = ["Featured/7GUIs", "Cookbook"]
1515

1616
[tool.flet.metadata]
1717
title = "Timer"

sdk/python/examples/apps/authentication/github_check_auth_results_and_toggle_ui/pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ dependencies = ["flet"]
1010
[dependency-groups]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

13-
[tool.flet.gallery]
14-
categories = ["Apps/Authentication"]
15-
1613
[tool.flet.metadata]
1714
title = "GitHub auth button toggle"
1815
controls = ["SafeArea", "Column", "Button", "GitHubOAuthProvider"]

sdk/python/examples/apps/authentication/github_login_same_page/pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ dependencies = ["flet"]
1010
[dependency-groups]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

13-
[tool.flet.gallery]
14-
categories = ["Apps/Authentication"]
15-
1613
[tool.flet.metadata]
1714
title = "GitHub login in same page"
1815
controls = ["SafeArea", "Column", "Button", "Text", "GitHubOAuthProvider", "UrlLauncher"]

sdk/python/examples/apps/authentication/github_minimal/pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ dependencies = ["flet"]
1010
[dependency-groups]
1111
dev = ["flet-cli", "flet-desktop", "flet-web"]
1212

13-
[tool.flet.gallery]
14-
categories = ["Apps/Authentication"]
15-
1613
[tool.flet.metadata]
1714
title = "Minimal GitHub login"
1815
controls = ["SafeArea", "Column", "Button", "Text", "GitHubOAuthProvider"]

0 commit comments

Comments
 (0)