-
Couldn't load subscription status.
- Fork 586
v1: Refactor NavigationDrawer, Pagelet API and usage
#5754
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
Open
FeodorFitsner
wants to merge
13
commits into
main
Choose a base branch
from
v1-pagelet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+540
−398
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
Refactored Pagelet drawer and end drawer open/close logic to use async invoke methods instead of property updates. Updated Python examples to use new async drawer methods and added a declarative example. Cleaned up related Dart code and removed unused imports.
Wraps the scaffold in a ClipRect when a drawer or endDrawer is present to ensure drawer animations remain hidden outside the pagelet bounds.
Removed NavigationDrawerPosition enum and dialog-based drawer handling. NavigationDrawer is now set via 'drawer' and 'end_drawer' properties on Page/Pagelet, with new async methods for showing and closing drawers. Updated Dart and Python code to support direct drawer control, removed ScaffoldKeyProvider, and revised examples and tests to use the new API. Fix #5386
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
Deploying flet-docs with
|
| Latest commit: |
8d97f68
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3fa2e025.flet-docs.pages.dev |
| Branch Preview URL: | https://v1-pagelet.flet-docs.pages.dev |
Deleted the navigationdrawerposition.md documentation file and its reference from mkdocs.yml, likely because the type is deprecated or no longer relevant.
Replaces manual window size assignments in navigation drawer integration tests with the new async resize_page method for consistency and reliability. Adds the resize_page utility to FletTestApp, improving test maintainability and accuracy. Updates golden images to reflect new window dimensions.
Replaces event-based waiting with polling to ensure window dimensions are updated correctly before and after adjusting for window chrome size. This change improves reliability of window resizing during tests.
Refactored the method to set window size by removing redundant update and wait steps. The window size is now set directly with chrome adjustments, improving efficiency.
Simplifies Pagelet reference handling by removing the use of ft.Ref and cast, assigning the Pagelet instance directly to a variable. Updates drawer handler functions to use the new variable reference.
Added a new declarative shape drawer example app using Flet's canvas. Updated integration tests for Cupertino and Material controls to use the new `resize_page` method for setting window size, replacing direct window property assignments. Updated multiple golden image files for test cases.
Replaces direct assignment of page window width and height with calls to the async resize_page method across multiple integration test files. This improves consistency and ensures proper asynchronous handling of window resizing for screenshot-based tests. Also updates related golden images to reflect any visual changes from the new resizing approach.
Enhanced the assertion error message in flet_test_app.py to include actual and threshold similarity values for easier debugging. Updated golden image for Cupertino bottom sheet basic test.
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.
Summary by Sourcery
Refactor drawer APIs and implementation in Pagelet and View controls to simplify programmatic open/close logic and unify control handling across Dart and Python SDKs
New Features:
Enhancements:
Documentation:
Tests: