-
Notifications
You must be signed in to change notification settings - Fork 600
fix: SnackBar and Banner not opening in cupertino pages
#5848
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
Conversation
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
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.
Pull request overview
This PR fixes an issue where SnackBar and Banner controls were not opening in Cupertino (iOS/macOS style) pages. The fix wraps CupertinoApp with a ScaffoldMessenger widget using the builder parameter, which provides the necessary Material infrastructure for these Material Design components to function in Cupertino apps.
Key changes:
- Added a
scaffoldMessengerBuilderfunction that wraps the app with Material theme and ScaffoldMessenger - Applied this builder to both
CupertinoAppandCupertinoApp.routervariants - Added test coverage for SnackBar in Cupertino pages
- Includes additional documentation improvements for ResponsiveRow and SegmentedButton controls
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/flet/lib/src/controls/page.dart | Core fix: Adds ScaffoldMessenger wrapper to CupertinoApp via builder parameter to enable Material components (SnackBar/Banner) in Cupertino pages |
| sdk/python/packages/flet/integration_tests/controls/material/test_snack_bar.py | Adds test case to verify SnackBar works in Cupertino pages with adaptive=True |
| sdk/python/packages/flet/integration_tests/controls/material/golden/macos/snack_bar/cupertino_page.png | Golden screenshot for Cupertino page SnackBar test |
| sdk/python/packages/flet/src/flet/controls/types.py | Improves documentation for ResponsiveRowBreakpoint enum with detailed descriptions |
| sdk/python/packages/flet/src/flet/controls/core/responsive_row.py | Enhances documentation for ResponsiveRow.breakpoints property |
| sdk/python/packages/flet/docs/controls/segmentedbutton.md | Refactors documentation to separate Segment class into its own page |
| sdk/python/packages/flet/docs/controls/segment.md | Adds dedicated documentation page for Segment class |
| sdk/python/packages/flet/docs/controls/responsiverow.md | Adds custom breakpoints example section |
| sdk/python/examples/controls/responsive_row/custom_breakpoint.py | Adds new example demonstrating custom breakpoints usage |
| sdk/python/examples/controls/responsive_row/basic.py | Updates example to use ResponsiveRowBreakpoint enum instead of string literals |
| sdk/python/packages/flet/mkdocs.yml | Updates navigation to include Segment as a nested item under SegmentedButton |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying flet-docs with
|
| Latest commit: |
461a5ed
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://24b2ad54.flet-docs.pages.dev |
| Branch Preview URL: | https://fix-snackbar-in-cupertino-pa.flet-docs.pages.dev |
…#5848) * Segment docs * Fix flet-dev#2944: add ResponsiveRow custom breakpoint example * fix: host snack bars in adaptive cupertino page * add test for snackbar in adaptive cupertino page * update test image * fix flet-dev#5370: add input formatters in dropdown * fix flet-dev#5562: `Pagelet` integration tests
Fix #3017
Example
Summary by Sourcery
Fix SnackBar visibility on Cupertino pages and improve responsive layout and segmented button documentation, including new examples and tests.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: