-
Notifications
You must be signed in to change notification settings - Fork 589
v1: Replace Colors.BLACK{shade} with BLACK_{shade}, WHITE{shade} with WHITE_{shade}
#5752
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
Corrects logic in Observable to set attribute directly if it does not exist, preventing unnecessary value comparison and notification for new attributes.
Simplifies logic for setting attributes by removing redundant checks and directly handling cases where the attribute may not exist. This improves code clarity and maintains correct notification behavior.
Moves attribute assignment before value comparison in Observable.__setattr__ to ensure correct notification behavior when attribute values change.
Introduced DeprecatedEnumMeta to support deprecated enum members and added deprecated color aliases to the Colors enum for backward compatibility. Deprecated aliases now emit a DeprecationWarning and redirect to the new member names. Also updated __all__ and imports to expose DeprecatedEnumMeta.
Replaces deprecated color constants like BLACK54, WHITE24, etc. with their new underscore-named versions (e.g., BLACK_54, WHITE_24) across all example, tutorial, and documentation files for consistency with the latest Flet API.
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
Colors.BLACK{shade} with Colors.BLACK_{shade}, Colors.WHITE{shade} with Colors.WHITE_{shade}Colors.BLACK{shade} with BLACK_{shade}, WHITE{shade} with WHITE_{shade}
Deploying flet-docs with
|
| Latest commit: |
a386059
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://61ddb42a.flet-docs.pages.dev |
| Branch Preview URL: | https://v1-color-deprecations.flet-docs.pages.dev |
|
#5736 (comment) |
Sure, it's already here: https://docs.flet.dev/controls/dismissible/?h=dismiss#remove-dismissible-on_dismiss-inside-component |
Added a TODO comment indicating that deprecated color aliases should be removed in Flet 1.0. This helps track planned cleanup for future releases.
Summary by Sourcery
Rename black and white opacity enum members to include an underscore, introduce a deprecation meta to alias and warn on the old names, update internal imports and utility exports, refine attribute setting in Observable, and adjust documentation and examples to use the new color names.
New Features:
Enhancements:
Documentation:
Chores: