-
Couldn't load subscription status.
- Fork 585
Handle non-event on_ fields in diff and protocol logic
#5742
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
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b1a24d8
Handle non-event 'on_' fields in diff and protocol logic
FeodorFitsner f34ab74
Refine event attribute detection in Jinja templates
FeodorFitsner b2d7f9d
Refactor event field handling and update color scheme test
FeodorFitsner 6f6cff4
Improve scrollable controls and spacing in views
FeodorFitsner 49e7226
Revamp color scheme integration test and screenshots
FeodorFitsner eb6dbea
Rename dismissable files and add declarative example
FeodorFitsner 1960251
Improve ListView prototype item handling
FeodorFitsner 14b8a46
Update integration test suite and doc formatting
FeodorFitsner 92e9305
Refactor color scheme test UI and update goldens
FeodorFitsner 9fed627
Update macOS color scheme golden images and test
FeodorFitsner fc34998
Refactor color scheme test to use Screenshot widgets
FeodorFitsner 1755454
Enable all test suites in macOS integration workflow
FeodorFitsner 8e8dbdc
Fix doc filter regex and marker doc typo
FeodorFitsner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {{ class_all_options("flet.ColorScheme") }} | ||
| {{ class_all_options("flet.ColorScheme", extra={'show_class_docstring': True, 'show_children': True,'events': []}) }} |
Binary file added
BIN
+23.4 KB
...tests/controls/theme/golden/macos/color_scheme/cupertino_action_sheet_basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions
74
sdk/python/packages/flet/integration_tests/controls/theme/test_color_scheme.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import pytest | ||
| import pytest_asyncio | ||
|
|
||
| import flet as ft | ||
| import flet.testing as ftt | ||
|
|
||
|
|
||
| # Create a new flet_app instance for each test method | ||
| @pytest_asyncio.fixture(scope="function", autouse=True) | ||
| def flet_app(flet_app_function): | ||
| return flet_app_function | ||
|
|
||
|
|
||
| @pytest.mark.asyncio(loop_scope="function") | ||
| async def test_color_scheme(flet_app: ftt.FletTestApp): | ||
| flet_app.page.theme = ft.Theme( | ||
| color_scheme=ft.ColorScheme( | ||
| primary=ft.Colors.GREEN, | ||
| on_primary=ft.Colors.YELLOW, | ||
| primary_container=ft.Colors.GREEN_900, | ||
| on_primary_container=ft.Colors.YELLOW, | ||
| secondary=ft.Colors.BLUE, | ||
| on_secondary=ft.Colors.WHITE, | ||
| secondary_container=ft.Colors.BLUE_900, | ||
| on_secondary_container=ft.Colors.WHITE, | ||
| tertiary=ft.Colors.RED, | ||
| on_tertiary=ft.Colors.WHITE, | ||
| tertiary_container=ft.Colors.RED_900, | ||
| on_tertiary_container=ft.Colors.WHITE, | ||
| error=ft.Colors.RED, | ||
| on_error=ft.Colors.WHITE, | ||
| error_container=ft.Colors.RED_900, | ||
| on_error_container=ft.Colors.WHITE, | ||
| surface=ft.Colors.ORANGE_400, | ||
| on_surface=ft.Colors.BLACK, | ||
| on_surface_variant=ft.Colors.RED, | ||
| outline=ft.Colors.BLUE_200, | ||
| outline_variant=ft.Colors.BLUE_400, | ||
| shadow=ft.Colors.BLACK, | ||
| scrim=ft.Colors.BLACK, | ||
| inverse_surface=ft.Colors.BLACK, | ||
| on_inverse_surface=ft.Colors.WHITE, | ||
| inverse_primary=ft.Colors.GREEN_900, | ||
| surface_tint=ft.Colors.GREEN, | ||
| on_primary_fixed=ft.Colors.WHITE, | ||
| on_secondary_fixed=ft.Colors.WHITE, | ||
| on_tertiary_fixed=ft.Colors.WHITE, | ||
| on_primary_fixed_variant=ft.Colors.WHITE, | ||
| on_secondary_fixed_variant=ft.Colors.WHITE, | ||
| on_tertiary_fixed_variant=ft.Colors.WHITE, | ||
| ) | ||
| ) | ||
|
|
||
| flet_app.page.enable_screenshots = True | ||
| flet_app.page.window.width = 400 | ||
| flet_app.page.window.height = 600 | ||
| flet_app.page.add( | ||
| ft.FilledButton("Primary button"), | ||
| ft.FilledTonalButton("Secondary button"), | ||
| ft.Container( | ||
| ft.Text("Container surface", color=ft.Colors.ON_SURFACE_VARIANT, size=20), | ||
| width=200, | ||
| height=100, | ||
| bgcolor=ft.Colors.SURFACE, | ||
| ), | ||
| ) | ||
| await flet_app.tester.pump_and_settle() | ||
|
|
||
| flet_app.assert_screenshot( | ||
| "cupertino_action_sheet_basic", | ||
FeodorFitsner marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| await flet_app.page.take_screenshot( | ||
| pixel_ratio=flet_app.screenshots_pixel_ratio | ||
| ), | ||
| ) | ||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.