feat: Add pop_until_with_result to Page#6347
Open
brunobrown wants to merge 8 commits intoflet-dev:release/v0.85.0from
Open
feat: Add pop_until_with_result to Page#6347brunobrown wants to merge 8 commits intoflet-dev:release/v0.85.0from
brunobrown wants to merge 8 commits intoflet-dev:release/v0.85.0from
Conversation
fb53c21 to
69312d1
Compare
Contributor
|
Thanks for the PR! A few notes:
|
69312d1 to
5fb749e
Compare
ndonkoHenri
reviewed
Mar 31, 2026
19a8a70 to
f1b4fd3
Compare
Contributor
|
Hey @brunobrown, can you change the base of your PR to |
f1b4fd3 to
c5fcfde
Compare
Contributor
|
Could you resolve conflicts please? |
Add the Page.pop_until_with_result() method and ViewPopResultEvent to support popping multiple views and returning a result to the destination view — the Flet equivalent of Flutter's Navigator.popUntilWithResult. Fixes flet-dev#6326
Add animated GIF demonstrating the pop_until_with_result feature for the navigation-routing documentation assets.
Rename pop_until_with_result() to pop_views_until(), on_view_pop_result to on_views_pop_until, and ViewPopResultEvent to ViewsPopUntilEvent. Requested by @FeodorFitsner in the PR review.
Remove standalone unit test file and add integration test to test_routing_navigation.py following the existing test pattern, as suggested by @ndonkoHenri in PR review.
…ation test The SnackBar and result_text both contained "Result: Flow completed!", causing find_by_text to match 2 elements instead of 1 in the CI integration test.
Convert pop_views_until example from single file to subdirectory with main.py + pyproject.toml, matching the new example structure introduced in v0.84.0. Fix flet_app_main references to use module.main format consistent with upstream.
Add new feature record to CHANGELOG.md for v0.85.0 as required by the release branch CI check.
fd90622 to
42854d7
Compare
ndonkoHenri
reviewed
Apr 8, 2026
Comment on lines
+538
to
+539
| Called when [`pop_views_until`][flet.Page.pop_views_until] reaches | ||
| the destination view. |
Contributor
There was a problem hiding this comment.
Please update your cross references in the modified/added docstrings to use the new style: https://github.com/flet-dev/flet/blob/main/.codex/skills/docs-conventions/SKILL.md?plain=1#L12
ndonkoHenri
reviewed
Apr 8, 2026
| `route` is found, then delivers `result` via the | ||
| [`on_views_pop_until`][flet.Page.on_views_pop_until] event. | ||
|
|
||
| This is the Flet equivalent of Flutter's `Navigator.popUntilWithResult`. |
Contributor
There was a problem hiding this comment.
Users dont usually have flutter knowledge, so we can remove this line.
ndonkoHenri
reviewed
Apr 8, 2026
Comment on lines
+937
to
+939
| Pops views from the navigation stack until a view with the given | ||
| `route` is found, then delivers `result` via the | ||
| [`on_views_pop_until`][flet.Page.on_views_pop_until] event. |
Contributor
There was a problem hiding this comment.
Update cross refs here too.
ndonkoHenri
reviewed
Apr 8, 2026
CHANGELOG.md
Outdated
|
|
||
| * Add `ft.use_dialog()` hook for declarative dialog management from within `@ft.component` functions, with frozen-diff reactive updates and automatic open/close lifecycle ([#6335](https://github.com/flet-dev/flet/pull/6335)) by @FeodorFitsner. | ||
| * Add `scrollable`, `pin_leading_to_top`, and `pin_trailing_to_bottom` properties to `NavigationRail` for scrollable content with optional pinned leading/trailing controls ([#1923](https://github.com/flet-dev/flet/issues/1923), [#6356](https://github.com/flet-dev/flet/pull/6356)) by @ndonkoHenri. | ||
| * Add `Page.pop_views_until()` to pop multiple views and return a result to the destination view ([#6326](https://github.com/flet-dev/flet/issues/6326), [#6347](https://github.com/flet-dev/flet/pull/6347)) by [@brunobrown](https://github.com/brunobrown). |
Contributor
There was a problem hiding this comment.
Suggested change
| * Add `Page.pop_views_until()` to pop multiple views and return a result to the destination view ([#6326](https://github.com/flet-dev/flet/issues/6326), [#6347](https://github.com/flet-dev/flet/pull/6347)) by [@brunobrown](https://github.com/brunobrown). | |
| * Add `Page.pop_views_until()` to pop multiple views and return a result to the destination view ([#6326](https://github.com/flet-dev/flet/issues/6326), [#6347](https://github.com/flet-dev/flet/pull/6347)) by @brunobrown. |
Use :class:, :meth:, :attr: reST roles in docstrings instead of mkdocs-style cross-references, per docs-conventions guidelines. Remove Flutter reference from pop_views_until docstring. Fix CHANGELOG author format to plain. Requested by @ndonkoHenri in PR review.
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
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
Add
Page.pop_until_with_result()method andViewPopResultEventto support popping multiple views from the navigation stack and returning a result to the destination view — the Flet equivalent of Flutter'sNavigator.popUntilWithResult.Fixes #6326
Test Code
Type of change
Checklist
Screenshots
Additional details
page.update()syncs the view list and Flutter's Navigator rebuilds with correct transitions automaticallyexamples/apps/routing_navigation/pop_until_with_result.pyFiles changed
sdk/python/packages/flet/src/flet/controls/page.pyViewPopResultEvent,pop_until_with_result(),on_view_pop_result, unifiedbefore_eventsdk/python/packages/flet/src/flet/__init__.pyViewPopResultEventsdk/python/packages/flet/tests/test_pop_until_with_result.pysdk/python/examples/apps/routing_navigation/pop_until_with_result.pysdk/python/packages/flet/docs/assets/navigation-routing/pop-until-with-result-example.gifSummary by Sourcery
Add support for popping multiple views with a result and wire it into page navigation events.
New Features:
Tests: