-
Notifications
You must be signed in to change notification settings - Fork 608
Enhance Tabs
#5496
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
Enhance Tabs
#5496
Conversation
Deploying flet-docs with
|
| Latest commit: |
c13b204
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://446a206a.flet-docs.pages.dev |
| Branch Preview URL: | https://v1-improve-tabs.flet-docs.pages.dev |
|
@sourcery-ai review |
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 enhances the Tabs component by splitting it into separate TabBar and TabBarView controls, introducing new configuration options and improved API design. It provides better flexibility for tab layouts with dedicated controls for tab headers and content areas.
Key changes include:
- Split Tabs into TabBar and TabBarView components with a unified Tabs wrapper
- Added new properties like
length,content,initial_index, and enhanced animation controls - Introduced TabAlignment enum and related tab indicator customization options
Reviewed Changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/packages/flet/src/flet/controls/types.py | Removed duplicate TabAlignment enum definition |
| sdk/python/packages/flet/src/flet/controls/theme.py | Renamed TabsTheme to TabBarTheme with updated properties |
| sdk/python/packages/flet/src/flet/controls/material/tabs.py | Major refactor splitting Tabs into TabBar, TabBarView, and Tabs components |
| sdk/python/packages/flet/src/flet/controls/material/elevated_button.py | Refactored style handling to use copy_with pattern |
| packages/flet/lib/src/controls/tabs.dart | Complete rewrite implementing separate TabBar and TabBarView controls |
| sdk/python/examples/controls/tabs/*.py | Updated examples to use new TabBar/TabBarView structure |
| Documentation files | Updated navigation and documentation structure for new components |
sdk/python/packages/flet/src/flet/controls/material/elevated_button.py
Outdated
Show resolved
Hide resolved
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.
We've reviewed this pull request using the Sourcery rules engine
SourceryAI
left a comment
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
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
# Conflicts: # sdk/python/packages/flet/docs/controls/tabs/index.md
…to v1-improve-tabs
Fixes #5494
Test code
Summary by Sourcery
Split and enhance the Tabs component by introducing dedicated TabBar and TabBarView controls, a TabAlignment enum, and refined API properties (length, content, initial_index, animation_duration), along with corresponding Dart implementations using DefaultTabController. Expand project tooling with new Taskfile commands, update pre-commit hooks, and reorganize documentation to surface TabBar and TabBarView under a unified tabs section.
New Features:
Enhancements:
CI:
Documentation:
Summary by Sourcery
Enhance the Tabs system by splitting it into TabBar and TabBarView with richer Python and Dart APIs, introduce supporting enums and indicator controls, refine button styling, bolster project tooling, update pre-commit hooks, and reorganize documentation
New Features:
Enhancements:
CI:
Documentation:
Chores: