v1 fix: Update properties or actions of opened AlertDialog #5547
Merged
FeodorFitsner merged 8 commits intomainfrom Aug 15, 2025
Merged
v1 fix: Update properties or actions of opened AlertDialog #5547FeodorFitsner merged 8 commits intomainfrom
FeodorFitsner merged 8 commits intomainfrom
Conversation
Removed deprecated 'open' and 'close' methods in favor of 'show_dialog' and 'pop_dialog'. Enhanced 'show_dialog' to better manage dialog lifecycle and dismissal, including improved event handling and error checking. Updated docstrings for clarity and maintainability. Fix #5439
Replaces direct widget construction with ControlInheritedNotifier in both AlertDialogControl and CupertinoAlertDialogControl for improved state management. Error handling is now managed via a string error message instead of an ErrorControl widget instance.
Deploying flet-docs with
|
| Latest commit: |
11041c2
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://470ea8bf.flet-docs.pages.dev |
| Branch Preview URL: | https://v1-alert-dialog-fix.flet-docs.pages.dev |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues with updating properties or actions of opened AlertDialog, CupertinoAlertDialog, and Banner controls by replacing cached dialog instances with live rebuilding through ControlInheritedNotifier. The fix addresses stale dialog instances and improves the Python SDK dialog lifecycle methods.
- Replaces cached
_dialogfields withControlInheritedNotifierwrapper for live updates - Improves Python SDK dialog methods by removing deprecated functions and enhancing async handling
- Adds integration tests to verify dynamic dialog property updates
Reviewed Changes
Copilot reviewed 6 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
sdk/python/packages/flet/src/flet/controls/base_page.py |
Removes deprecated methods, enhances show_dialog/pop_dialog with better async handling and documentation |
packages/flet/lib/src/controls/alert_dialog.dart |
Wraps dialog in ControlInheritedNotifier for live updates, removes cached _dialog field |
packages/flet/lib/src/controls/cupertino_alert_dialog.dart |
Similar changes to AlertDialog - adds ControlInheritedNotifier wrapper and removes caching |
packages/flet/lib/src/controls/banner.dart |
Simplifies banner creation by removing caching and using direct error string handling |
sdk/python/packages/flet/integration_tests/controls/test_alert_dialog.py |
Adds test for dynamic dialog property updates with screenshots |
sdk/python/packages/flet/integration_tests/controls/test_cupertino_alert_dialog.py |
Adds test for dynamic Cupertino dialog action updates with screenshots |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ndonkoHenri
reviewed
Aug 15, 2025
ndonkoHenri
reviewed
Aug 15, 2025
ndonkoHenri
reviewed
Aug 15, 2025
ndonkoHenri
reviewed
Aug 15, 2025
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.
Fix #5487
Fix #5439
Summary by Sourcery
Enable live updates of AlertDialog, CupertinoAlertDialog, and Banner controls by rebuilding them via ControlInheritedNotifier instead of caching, add error handling for missing content, and enhance the Python SDK dialog lifecycle methods by removing deprecated Page.open/close and improving show_dialog/pop_dialog docstrings and async on_dismiss handling.
Bug Fixes:
Enhancements:
Documentation: