chore!: remove deprecated module-level margin/padding/border/border_radius helpers#6425
chore!: remove deprecated module-level margin/padding/border/border_radius helpers#6425ndonkoHenri wants to merge 4 commits intorelease/v0.85.0from
margin/padding/border/border_radius helpers#6425Conversation
Deploying flet-website-v2 with
|
| Latest commit: |
b3ac558
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ccdaecfa.flet-website-v2.pages.dev |
| Branch Preview URL: | https://remove-overdue-deprecations.flet-website-v2.pages.dev |
Deploying flet-examples with
|
| Latest commit: |
b3ac558
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a61fe508.flet-examples.pages.dev |
| Branch Preview URL: | https://remove-overdue-deprecations.flet-examples.pages.dev |
There was a problem hiding this comment.
Pull request overview
Removes long-deprecated module-level margin/padding/border/border_radius helper functions from the Python SDK and updates docs/examples to use the corresponding class-based APIs.
Changes:
- Delete deprecated module-level helper functions from
flet.controls(Margin,Padding,Border,BorderRadiusmodules). - Update documentation, blog posts, and SDK examples to use
ft.Margin.*,ft.Padding.*,ft.Border.*,ft.BorderRadius.*and newerft.Alignment.*constants. - Minor tutorial/example cleanups (import reorder, docstring/comment formatting).
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/types/borderradius.md | Updates docs snippet to use ft.BorderRadius.all() |
| website/docs/tutorials/solitaire.md | Replaces deprecated border/border_radius helpers with class-based APIs |
| website/docs/tutorials/chat.md | Updates border helper usage to ft.Border.all() |
| website/docs/extend/user-extensions.md | Updates deprecated alignment constant usage |
| website/docs/cookbook/large-lists.md | Updates alignment/border/border_radius usage to class-based APIs |
| website/docs/cookbook/drag-and-drop.md | Updates Row usage and alignment/border helper usage in snippets |
| website/docs/cookbook/colors.md | Updates border helper usage to ft.Border.all() |
| website/blog/2023-05-12-theming-and-scrollables.md | Updates border helper usage in blog example |
| sdk/python/packages/flet/src/flet/controls/padding.py | Removes deprecated module-level padding.* helpers and export entries |
| sdk/python/packages/flet/src/flet/controls/material/container.py | Updates embedded doc example to ft.Border.all() |
| sdk/python/packages/flet/src/flet/controls/margin.py | Removes deprecated module-level margin.* helpers and export entries |
| sdk/python/packages/flet/src/flet/controls/border_radius.py | Removes deprecated module-level border_radius.* helpers and export entries |
| sdk/python/packages/flet/src/flet/controls/border.py | Removes deprecated module-level border.* helpers and export entries |
| sdk/python/examples/tutorials/solitaire/solitaire-game-setup/solitaire.py | Updates border helper usage; reorders imports |
| sdk/python/examples/tutorials/solitaire/solitaire-game-setup/slot.py | Updates border radius helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-game-setup/card.py | Updates border radius helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-game-rules/solitaire.py | Updates border helper usage; reorders imports |
| sdk/python/examples/tutorials/solitaire/solitaire-game-rules/slot.py | Updates border radius helper usage; import ordering tweak |
| sdk/python/examples/tutorials/solitaire/solitaire-game-rules/card.py | Updates border radius helper usage; docstring/comment edits |
| sdk/python/examples/tutorials/solitaire/solitaire-final/solitaire.py | Updates border helper usage; reorders imports |
| sdk/python/examples/tutorials/solitaire/solitaire-final/slot.py | Updates border radius helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-final/settings.py | Updates border/border radius helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-final/card.py | Updates border radius helper usage; docstring edit |
| sdk/python/examples/tutorials/solitaire/solitaire-final-part1/solitaire.py | Updates border helper usage; reorders imports |
| sdk/python/examples/tutorials/solitaire/solitaire-final-part1/slot.py | Updates border radius helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-final-part1/card.py | Updates border radius helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-fanned-piles/slot.py | Updates border helper usage; import ordering tweak |
| sdk/python/examples/tutorials/solitaire/solitaire-drag-and-drop/step4.py | Updates border helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-drag-and-drop/step3.py | Updates border helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-drag-and-drop/step2.py | Updates border helper usage |
| sdk/python/examples/tutorials/solitaire/solitaire-classes/slot.py | Updates border helper usage; import ordering tweak |
| sdk/python/examples/controls/types/border/container/main.py | Updates border_radius helpers to ft.BorderRadius.* |
| CHANGELOG.md | Adds changelog entry for the breaking removal of deprecated helpers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from card import Card | ||
| from slot import Slot | ||
|
|
||
| import flet as ft | ||
|
|
There was a problem hiding this comment.
Import grouping/order is inconsistent with other solitaire tutorial examples: third-party imports (e.g., import flet as ft) are typically placed before local imports (from card import Card, from slot import Slot). Consider reordering to match the established pattern used in sdk/python/examples/tutorials/solitaire/solitaire-classes/solitaire.py and solitaire-fanned-piles/solitaire.py.
| from card import Card | |
| from slot import Slot | |
| import flet as ft | |
| import flet as ft | |
| from card import Card | |
| from slot import Slot |
| from card import Card | ||
| from slot import Slot | ||
|
|
||
| import flet as ft | ||
|
|
There was a problem hiding this comment.
Import grouping/order is inconsistent with other solitaire tutorial examples: third-party imports (e.g., import flet as ft) are typically placed before local imports (from card import Card, from slot import Slot). Consider reordering to match the established pattern used in sdk/python/examples/tutorials/solitaire/solitaire-classes/solitaire.py and solitaire-fanned-piles/solitaire.py.
| from card import Card | |
| from slot import Slot | |
| import flet as ft | |
| import flet as ft | |
| from card import Card | |
| from slot import Slot |
| from card import Card | ||
| from slot import Slot | ||
|
|
||
| import flet as ft | ||
|
|
||
|
|
There was a problem hiding this comment.
Import grouping/order is inconsistent with other solitaire tutorial examples: third-party imports (e.g., import flet as ft) are typically placed before local imports (from card import Card, from slot import Slot). Consider reordering to match the established pattern used in sdk/python/examples/tutorials/solitaire/solitaire-classes/solitaire.py and solitaire-fanned-piles/solitaire.py.
| from card import Card | |
| from slot import Slot | |
| import flet as ft | |
| import flet as ft | |
| from card import Card | |
| from slot import Slot |
| from card import Card | ||
| from slot import Slot | ||
|
|
||
| import flet as ft | ||
|
|
There was a problem hiding this comment.
Import grouping/order is inconsistent with other solitaire tutorial examples: third-party imports (e.g., import flet as ft) are typically placed before local imports (from card import Card, from slot import Slot). Consider reordering to match the established pattern used in sdk/python/examples/tutorials/solitaire/solitaire-classes/solitaire.py and solitaire-fanned-piles/solitaire.py.
| from card import Card | |
| from slot import Slot | |
| import flet as ft | |
| import flet as ft | |
| from card import Card | |
| from slot import Slot |
| border_radius=5, | ||
| content=ft.Text("1", size=20), | ||
| alignment=ft.alignment.center, | ||
| alignment=ft.Alignment.CENTER, | ||
| ), |
There was a problem hiding this comment.
There’s still a later code snippet in this doc using the deprecated ft.alignment.center (around line 88). For consistency with the updated snippets (and to avoid showing deprecated API in the cookbook), update that remaining occurrence to ft.Alignment.CENTER as well.
| else: # slot == None when the cards are dealt and need to be place in slot for the first time | ||
| else: | ||
| # slot == None when the cards are dealt and | ||
| # need to be place in slot for the first time |
There was a problem hiding this comment.
Typo in the comment: “need to be place” should be “need to be placed”.
| # need to be place in slot for the first time | |
| # need to be placed in slot for the first time |
Summary by Sourcery
Remove deprecated module-level margin, padding, border, and border_radius helper functions and update usage across examples and docs to the class-based APIs.
Enhancements:
Documentation:
Chores: