-
Notifications
You must be signed in to change notification settings - Fork 590
feat: BottomSheet.fullscreen and CupertinoActivityIndicator.progress
#5793
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
ndonkoHenri
wants to merge
9
commits into
main
Choose a base branch
from
fullscreen-bottom-sheet
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.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
31a0872
Rename `date_picker_entry_mode` to `entry_mode` in `DatePicker` and `…
ndonkoHenri 33c721a
feat: add fullscreen support to `BottomSheet` with docs + example
ndonkoHenri 10518a0
feat: `CupertinoActivityIndicator.progress`
ndonkoHenri acd4ff0
Apply suggestion from @Copilot
ndonkoHenri 697f5a3
more docs
ndonkoHenri cfbd4e1
fix markdown tests: set similarity threshold to 97
ndonkoHenri 67ecb4c
Merge branch 'main' into fullscreen-bottom-sheet
ndonkoHenri fee320b
test `BottomSheet.fullscreen`
ndonkoHenri 5389528
delete `basic.gif`
ndonkoHenri 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
Empty file.
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 |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import flet as ft | ||
|
|
||
|
|
||
| def main(page: ft.Page): | ||
| page.horizontal_alignment = ft.CrossAxisAlignment.CENTER | ||
|
|
||
| def handle_switch_change(e: ft.Event[ft.Switch]): | ||
| sheet.fullscreen = e.control.value | ||
|
|
||
| sheet = ft.BottomSheet( | ||
| fullscreen=True, | ||
| show_drag_handle=True, | ||
| content=ft.Container( | ||
| padding=ft.Padding.all(10), | ||
| content=ft.Column( | ||
| horizontal_alignment=ft.CrossAxisAlignment.CENTER, | ||
| controls=[ | ||
| ft.Text("This is bottom sheet's content!"), | ||
| ft.Button("Close bottom sheet", on_click=lambda: page.pop_dialog()), | ||
| ], | ||
| ), | ||
| ), | ||
| ) | ||
|
|
||
| page.add( | ||
| ft.Button( | ||
| content="Display bottom sheet", | ||
| on_click=lambda e: page.show_dialog(sheet), | ||
| ), | ||
| ft.Switch(value=True, label="Fullscreen", on_change=handle_switch_change), | ||
| ) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| ft.run(main) |
Binary file not shown.
26 changes: 26 additions & 0 deletions
26
sdk/python/examples/controls/cupertino_activity_indicator/progress.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,26 @@ | ||
| import flet as ft | ||
|
|
||
|
|
||
| async def main(page: ft.Page): | ||
| page.horizontal_alignment = ft.CrossAxisAlignment.CENTER | ||
| page.spacing = 20 | ||
|
|
||
| def handle_progress_change(e: ft.Event[ft.Slider]): | ||
| indicator.progress = e.control.value | ||
|
|
||
| page.add( | ||
| indicator := ft.CupertinoActivityIndicator(progress=1.0, radius=40), | ||
| ft.Slider( | ||
| min=0.0, | ||
| value=indicator.progress, | ||
| max=1.0, | ||
| divisions=10, | ||
| round=1, | ||
| label="Progress = {value}", | ||
| width=400, | ||
| on_change=handle_progress_change, | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| ft.run(main) | ||
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
Binary file added
BIN
+2.58 KB
...on_tests/controls/cupertino/golden/macos/cupertino_activity_indicator/basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.41 KB
...tests/controls/cupertino/golden/macos/cupertino_activity_indicator/progress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions
28
...n/packages/flet/integration_tests/controls/cupertino/test_cupertino_activity_indicator.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,28 @@ | ||
| import pytest | ||
|
|
||
| import flet as ft | ||
| import flet.testing as ftt | ||
|
|
||
|
|
||
| @pytest.mark.asyncio(loop_scope="module") | ||
| async def test_basic(flet_app: ftt.FletTestApp, request): | ||
| await flet_app.assert_control_screenshot( | ||
| request.node.name, | ||
| ft.CupertinoActivityIndicator( | ||
| radius=30, | ||
| color=ft.CupertinoColors.DARK_BACKGROUND_GRAY, | ||
| animating=False, | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.asyncio(loop_scope="module") | ||
| async def test_progress(flet_app: ftt.FletTestApp, request): | ||
| await flet_app.assert_control_screenshot( | ||
| request.node.name, | ||
| ft.CupertinoActivityIndicator( | ||
| radius=30, | ||
| color=ft.CupertinoColors.DARK_BACKGROUND_GRAY, | ||
| progress=0.5, | ||
| ), | ||
| ) |
Binary file renamed
BIN
+18.1 KB
...macos/bottom_sheet/bottom_sheet_basic.png → ...erial/golden/macos/bottom_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.
Binary file added
BIN
+17.9 KB
...et/integration_tests/controls/material/golden/macos/bottom_sheet/fullscreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file added
BIN
+14.2 KB
...es/flet/integration_tests/examples/material/golden/macos/bottom_sheet/basic.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.2 KB
.../flet/integration_tests/examples/material/golden/macos/bottom_sheet/basic_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+23.8 KB
.../flet/integration_tests/examples/material/golden/macos/bottom_sheet/basic_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.3 KB
...et/integration_tests/examples/material/golden/macos/bottom_sheet/fullscreen.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.3 KB
.../integration_tests/examples/material/golden/macos/bottom_sheet/fullscreen_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.8 KB
.../integration_tests/examples/material/golden/macos/bottom_sheet/fullscreen_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.3 KB
.../integration_tests/examples/material/golden/macos/bottom_sheet/fullscreen_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.9 KB
.../integration_tests/examples/material/golden/macos/bottom_sheet/fullscreen_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.8 KB
.../integration_tests/examples/material/golden/macos/bottom_sheet/fullscreen_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.