-
Notifications
You must be signed in to change notification settings - Fork 599
fix: Ensure consistent TextStyle inheritance during button state transitions
#5901
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
…ignment handling
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 TextStyle inheritance issues during button state transitions by setting inherit: false on button text styles, which prevents TextStyle.lerp assertion errors when animating between states. The change also includes various code quality improvements and documentation enhancements.
- Core fix: Modified button text style handling to explicitly set
inherit: falseto match Material button defaults - Refactored text parsing utilities to extract reusable helper functions
- Improved Python code quality with better exception handling and import organization
- Enhanced documentation for Row, ResponsiveRow, and Lottie controls
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/pyproject.toml | Added flet_desktop and flet_web to isort's known-first-party packages |
| sdk/python/packages/flet/src/flet/utils/pip.py | Replaced bare except with except Exception, removed redundant imports, improved error message formatting |
| sdk/python/packages/flet/src/flet/controls/core/row.py | Enhanced documentation with proper example formatting and detailed property notes |
| sdk/python/packages/flet/src/flet/controls/core/responsive_row.py | Improved documentation and fixed trailing whitespace |
| sdk/python/packages/flet-lottie/src/flet_lottie/lottie.py | Added note about layer effects limitations with relevant issue links |
| packages/flet/lib/src/utils/text.dart | Extracted parseFontVariations and parseTextDecorations as reusable helper functions |
| packages/flet/lib/src/utils/buttons.dart | Introduced parseButtonTextStyle wrapper that sets inherit: false to prevent TextStyle.lerp assertions |
| packages/flet/lib/src/controls/row.dart | Refactored to use extension methods for better code organization |
| packages/flet/lib/src/controls/button.dart | Code formatting improvements and simplified variable usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying flet-docs with
|
| Latest commit: |
7190ce5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9f1c06f4.flet-docs.pages.dev |
| Branch Preview URL: | https://fix-button-text-style.flet-docs.pages.dev |
Fix #5620
Fix #5278
Fix #5895
Summary by Sourcery
Improve button text style handling and polish layout, utilities, and documentation across Flutter and Python SDK components.
Bug Fixes:
Enhancements:
Build: