-
Notifications
You must be signed in to change notification settings - Fork 595
Minor fixes for control examples #5831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Updated brush_on_image.py to remove invalid width and set expand on Stack for proper layout. Added a missing newline in bottomsheet.md for improved markdown formatting.
Refactored chart and color examples for improved clarity and modern Python practices, including use of dataclasses and async clipboard handling. Enhanced custom scrollbar and infinite scrolling examples with more realistic content and fixed key usage. Updated documentation to require both 'plotly' and 'kaleido' for PlotlyChart. Added 'matplotlib', 'plotly', and 'kaleido' to dependencies in pyproject.toml.
Updated scroll event handler to use generic OnScrollEvent type in column example. Replaced ft.border.all with ft.Border.all in nested container themes example for correct class usage.
Replaced deprecated usages in CupertinoButton and CupertinoRadio examples to match updated Flet API. Refactored CupertinoTimerPicker example to simplify timer value handling and fix event data usage.
Corrected color constant names and border usage in DataTable examples. Refactored sorting logic in datatable2 example to properly sort data and update table state, and fixed initialization of sorted data and DataTable2 instance.
Moves DatePicker creation outside the button click handler to reuse the same instance. This simplifies the code and avoids creating a new DatePicker object on each click.
Moves DateRangePicker creation outside the button click handler to avoid redundant instantiation. The picker is now created once and reused when the button is clicked.
Deleted ordering.py and outer_inner.py from the drag_target_and_draggable examples to clean up deprecated or redundant code. Also fixed a color constant typo in drag_and_drop_containers.py.
Added two new Python examples demonstrating declarative drag-and-drop: one for containers and one for ordering items and groups. Updated draggable.md documentation to reference the new declarative containers example.
Renamed 'reactive.py' to 'declarative.py' for clarity. Removed unused logging setup from 'basic.py'. Fixed icon name reference in 'dropdown_random_icon.py' to use 'icon.icon' instead of 'icon.name'.
Replaces incorrect usage of 'name' with 'icon' for the trailing property in ExpansionTile event handlers. Also updates SnackBar text assignment for ruff formatting.
Replaced usage of delta_x and delta_y with local_delta.x and local_delta.y in draggable_containers.py for more accurate drag updates. Simplified mouse cursor change logic in mouse_cursors.py by using random.choice instead of a generator.
Added app_icon_512.png and updated gallery.py to use the new image asset. Fixed property names and usage in static_svg.py, handling_events.py, and outlined_button/icons.py to use correct constants and class references for colors, margins, and icons.
Replaces 'ft.Colors.BLACK54' with 'ft.Colors.BLACK_54' to use the correct color constant for the button border.
Changed event handler print statements to output the control object instead of its uid for better debugging and information in rich text example.
Corrected multi-line string assignment in prefix_and_suffix.py to properly display textbox values. Updated styled.py to use the correct color constant 'BLACK_26' instead of 'BLACK26'.
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've reviewed this pull request using the Sourcery rules engine
ndonkoHenri
reviewed
Nov 19, 2025
Comment on lines
+6
to
24
| if e.control.data: | ||
| if e.control.data == 1: | ||
| row1.selected = not row1.selected | ||
| case 2: | ||
| elif e.control.data == 2: | ||
| row2.selected = not row2.selected | ||
| case 3: | ||
| elif e.control.data == 3: | ||
| row3.selected = not row3.selected | ||
| page.update() | ||
|
|
||
| def handle_column_sort(e: ft.DataColumnSortEvent): | ||
| match e.control.data: | ||
| case 1: | ||
| if e.control.data: | ||
| if e.control.data == 1: | ||
| print(f"{e.column_index}, {e.ascending}") | ||
| # table.sort_column_index = 1 | ||
| table.sort_ascending = e.ascending | ||
| case 2: | ||
| elif e.control.data == 2: | ||
| print(f"{e.column_index}, {e.ascending}") | ||
| # table.sort_column_index = 2 | ||
| table.sort_ascending = e.ascending |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.control.data could be stored in a variable for better code readability.
ndonkoHenri
reviewed
Nov 19, 2025
sdk/python/examples/controls/drag_target_and_draggable/drag_and_drop_ordering_declarative.py
Outdated
Show resolved
Hide resolved
ndonkoHenri
reviewed
Nov 19, 2025
Eliminated unnecessary logging configuration and logger level settings from the drag_and_drop_ordering_declarative.py example to simplify the code.
Deploying flet-docs with
|
| Latest commit: |
0189602
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://db38ab19.flet-docs.pages.dev |
| Branch Preview URL: | https://inesa-test-examples.flet-docs.pages.dev |
matplotlib, plotly, and kaleido have been moved from main dependencies to dev dependencies in pyproject.toml. This reduces the default install footprint for end users and keeps plotting tools available for development and testing.
FeodorFitsner
approved these changes
Nov 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Test Code
# Test code for the review of this PRType of change
Checklist
Screenshots
Additional details
Summary by Sourcery
Refine and fix various Python SDK example scripts by updating code to match current APIs, correcting constant names, improving functionality in data table sorting and infinite scrolling, consolidating dialog component instantiation, and cleaning up imports and formatting. Add new declarative drag-and-drop examples for grouping and ordering, update dependencies for chart support, and refresh documentation sections accordingly.
New Features:
Enhancements:
Build:
Documentation: