-
Notifications
You must be signed in to change notification settings - Fork 585
feat: Programmatically expand/collapse ExpansionTile
#5738
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
base: main
Are you sure you want to change the base?
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 adds programmatic expansion/collapse functionality to the ExpansionTile control by introducing an expanded property, replacing the previous initially_expanded property which only set the initial state. The implementation includes animation customization support and comprehensive documentation updates.
- Adds
expandedproperty to control tile state programmatically - Introduces
animation_styleproperty for customizing expansion/collapse animations - Updates documentation with examples and enhanced property descriptions
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/packages/flet/src/flet/controls/material/expansion_tile.py | Adds expanded and animation_style properties, replaces initially_expanded, enhances documentation, and adds validation for CrossAxisAlignment.BASELINE |
| packages/flet/lib/src/controls/expansion_tile.dart | Converts to StatefulWidget with ExpansibleController to manage programmatic expansion state |
| sdk/python/packages/flet/src/flet/controls/animation.py | Adds AnimationStyle class documentation and no_animation() static method |
| sdk/python/packages/flet/src/flet/controls/theme.py | Adds theme properties for ExpansionTile and ListTile including animation_style, shape, collapsed_shape, affinity, style, and title_alignment |
| sdk/python/examples/controls/expansion_tile/programmatic_expansion.py | New example demonstrating programmatic tile expansion/collapse |
| sdk/python/examples/controls/expansion_tile/custom_animations.py | New example showing custom animation styles for expansion tile |
| sdk/python/packages/flet/docs/controls/expansiontile.md | Adds documentation sections for programmatic expansion and custom animations |
| packages/flet/lib/src/utils/theme.dart | Updates theme parsers to support new ExpansionTile and ListTile theme properties |
| sdk/python/packages/flet/src/flet/controls/material/text_button.py | Minor documentation wording improvement |
| sdk/python/packages/flet/src/flet/controls/material/expansion_panel.py | Minor documentation wording improvement |
| sdk/python/packages/flet/src/flet/controls/cupertino/cupertino_sliding_segmented_button.py | Simplifies documentation and reorders example property |
| packages/flet/lib/src/controls/cupertino_sliding_segmented_button.dart | Minor code formatting and logic simplification |
| sdk/python/packages/flet/src/flet/controls/base_control.py | Adds internal documentation for _internals field |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
sdk/python/packages/flet/src/flet/controls/material/expansion_tile.py
Outdated
Show resolved
Hide resolved
Deploying flet-docs with
|
| Latest commit: |
5b496f0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://37bb4812.flet-docs.pages.dev |
| Branch Preview URL: | https://expansion-tile-feat.flet-docs.pages.dev |
|
Please fix tests: https://github.com/flet-dev/flet/actions/runs/18736961772
|
Fix #3626
Example
Summary by Sourcery
Enable programmatic control of ExpansionTile expansion state and customizable animation behavior.
New Features:
Bug Fixes:
Enhancements: