refactor!: Remove all deprecated APIs for a deprecation-free 1.0#6693
Open
ndonkoHenri wants to merge 9 commits into
Open
refactor!: Remove all deprecated APIs for a deprecation-free 1.0#6693ndonkoHenri wants to merge 9 commits into
ndonkoHenri wants to merge 9 commits into
Conversation
…rols APIs Removes APIs deprecated in 0.85.0 as part of the pre-v1 deprecation cleanup: - DragTargetEvent.x/.y/.offset -> use local_position / global_position - Video.show_controls -> set controls=None to hide controls - Video.playlist_add()/playlist_remove() -> mutate Video.playlist directly Also simplifies the flet_video Dart control (the show_controls gate is now dead code) and updates the root + flet-video changelogs and the 0.85.0 migration guides.
… flag Continues the pre-1.0 deprecation cleanup: - Remove FletApp.show_app_startup_screen and FletApp.app_startup_screen_message (deprecated in 0.86.0) -> use boot_screen_options - Remove the --clear-cache flag of flet build / flet debug (deprecated in 0.86.0) -> use the flet clean command; the flag's build/flutter deletion behavior is removed with it - Finalize the cleanup changelog version placeholder from 'Unreleased' to 1.0.0 (root + flet-video changelogs and the 0.85.0/0.86.0 migration-guide timelines)
Continues the pre-1.0 deprecation cleanup: - Remove Page.go() (deprecated in 0.80.0) -> use Page.push_route() - Remove the Page.url_launcher, Page.browser_context_menu, Page.shared_preferences, Page.clipboard, and Page.storage_paths service accessors (deprecated in 0.80.0) -> instantiate the service classes directly: UrlLauncher(), BrowserContextMenu(), SharedPreferences(), Clipboard(), StoragePaths() - Migrate two examples off the removed accessors
… Colors aliases Completes the scheduled (1.0) deprecation removals: - Remove the ConstrainedControl base class (deprecated 0.80.0) -> inherit from LayoutControl - Remove ElevatedButton (deprecated 0.80.0) -> use Button - Remove DropdownM2 and the dropdownm2 module, incl. its Dart widget and control registration (deprecated 0.84.0) -> use Dropdown - Remove the 14 deprecated non-underscored Colors aliases (BLACK12..WHITE70) -> use the underscored names; revert Colors to a plain Enum - Clean up flet package exports, delete the DropdownM2 docs page and sidebar entry, and migrate one example type annotation to ft.Button
…ee 1.0 Sweeps the deprecations that had no scheduled removal version: - Remove app() and app_async() (deprecated 0.80.0) -> use run()/run_async() - Remove the target= alias parameter of run()/run_async() -> pass main - Remove Page.launch_url()/can_launch_url()/close_in_app_web_view() (deprecated 0.90.0) -> use UrlLauncher() - Remove the legacy [tool.flet.app.boot_screen]/[tool.flet.app.startup_screen] build-config fallback -> use [tool.flet.boot_screen] - Remove the Dart empty-string widget-state key back-compat mapping -> 'default' - Migrate 8 examples + the authentication cookbook doc off page.launch_url() to ft.UrlLauncher().launch_url() (and fix a stale web_window_name kwarg)
Reverses the DropdownM2 removal from 76e33fa and drops its deprecation: - Restore the Python control, the Dart widget + its control registration, and the docs page - Strip the @deprecated_class decorator (and its import) so DropdownM2 is no longer deprecated - Re-add the flet package exports (class + module) and the sidebar entry DropdownM2 remains a supported control; its 0.84.0 deprecation in favor of Dropdown is reverted.
…waited) SimpleAttribution.on_click used `lambda e: ft.UrlLauncher().launch_url(...)`, but launch_url is async — Flet's sync-handler dispatch calls the lambda and discards the returned coroutine, so it was never awaited and the click did nothing. Replace with a proper `async def` handler that Flet awaits. This was a pre-existing bug (the prior `page.launch_url()` form was also async).
Deploying flet-website-v2 with
|
| Latest commit: |
218947c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d7b7bce0.flet-website-v2.pages.dev |
| Branch Preview URL: | https://fix-remove-deprecations.flet-website-v2.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prepares Flet for a deprecation-free 1.0 by removing previously deprecated public APIs across Python, Dart, CLI tooling, docs, and examples, and updating references to their supported replacements.
Changes:
- Removed deprecated Python APIs (navigation helpers, service accessors, legacy controls, color aliases) and updated exports accordingly.
- Removed deprecated CLI/build flags and legacy build config fallbacks, aligning tooling with current commands/config keys.
- Updated docs, changelogs, Dart back-compat behavior, and multiple examples to use the new APIs (e.g.,
UrlLauncher(),Button,"default"widget-state key).
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/updates/breaking-changes/v0-86-0/deprecated-clear-cache-flag.md | Updates timeline/references for --clear-cache removal in 1.0.0. |
| website/docs/updates/breaking-changes/v0-85-0/deprecated-video-apis.md | Updates timeline/references for deprecated Video APIs removal in 1.0.0. |
| website/docs/updates/breaking-changes/v0-85-0/deprecated-drag-target-event-coordinates.md | Updates timeline/references for drag event coordinate fields removal in 1.0.0. |
| website/docs/cookbook/authentication.md | Migrates auth flow URL opening to ft.UrlLauncher() APIs. |
| sdk/python/packages/flet/src/flet/controls/page.py | Removes deprecated Page.go() and URL-launch/service accessor helpers. |
| sdk/python/packages/flet/src/flet/controls/material/elevated_button.py | Removes deprecated ElevatedButton wrapper (file deleted). |
| sdk/python/packages/flet/src/flet/controls/material/dropdownm2.py | Undeprecates DropdownM2 by removing its deprecation wrapper. |
| sdk/python/packages/flet/src/flet/controls/layout_control.py | Removes deprecated ConstrainedControl alias in favor of LayoutControl. |
| sdk/python/packages/flet/src/flet/controls/core/flet_app.py | Removes deprecated boot screen convenience properties from FletApp. |
| sdk/python/packages/flet/src/flet/controls/core/drag_target.py | Removes deprecated DragTargetEvent coordinate aliases. |
| sdk/python/packages/flet/src/flet/controls/colors.py | Removes deprecated color aliases and reverts Colors to a plain Enum. |
| sdk/python/packages/flet/src/flet/app.py | Removes deprecated app()/app_async() and target= aliasing in run()/run_async(). |
| sdk/python/packages/flet/src/flet/init.py | Stops exporting removed/legacy symbols (e.g., app, ConstrainedControl, ElevatedButton). |
| sdk/python/packages/flet-video/src/flutter/flet_video/lib/src/video.dart | Drops show_controls handling on the Dart side. |
| sdk/python/packages/flet-video/src/flet_video/video.py | Removes deprecated Video.show_controls and playlist helper methods. |
| sdk/python/packages/flet-video/CHANGELOG.md | Documents removed video APIs in the flet-video 1.0.0 changelog. |
| sdk/python/packages/flet-cli/src/flet_cli/commands/build_base.py | Removes deprecated --clear-cache flag and legacy boot/startup screen config fallback. |
| sdk/python/examples/extensions/map/multi_layers/main.py | Fixes attribution click handling by awaiting URL launch via UrlLauncher(). |
| sdk/python/examples/extensions/map/interaction_flags/main.py | Fixes attribution click handling by awaiting URL launch via UrlLauncher(). |
| sdk/python/examples/extensions/map/idle_camera/main.py | Fixes attribution click handling by awaiting URL launch via UrlLauncher(). |
| sdk/python/examples/extensions/map/camera_controls/main.py | Fixes attribution click handling by awaiting URL launch via UrlLauncher(). |
| sdk/python/examples/extensions/charts/line_chart/line_chart_with_custom_axes/main.py | Updates handler typing/usages to Button after ElevatedButton removal. |
| sdk/python/examples/extensions/audio_recorder/audio_recorder/main.py | Migrates page.launch_url() usage to UrlLauncher(). |
| sdk/python/examples/controls/material/context_menu/triggers/main.py | Migrates page.browser_context_menu usage to BrowserContextMenu(). |
| sdk/python/examples/controls/core/markdown/markdown/main.py | Migrates page.launch_url() usage to UrlLauncher(). |
| sdk/python/examples/controls/core/markdown/listviews/main.py | Migrates page.launch_url() usage to UrlLauncher(). |
| sdk/python/examples/controls/core/markdown/code_syntax_highlight/main.py | Migrates page.launch_url() usage to UrlLauncher(). |
| sdk/python/examples/apps/declarative/trolli/components/dialogs.py | Migrates page.shared_preferences accessor usage to SharedPreferences(). |
| packages/flet/lib/src/utils/widget_state.dart | Removes Dart-side empty-string widget-state key back-compat mapping. |
| CHANGELOG.md | Adds 1.0.0 breaking changes entry documenting all removals/changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…_context_menu The ContextMenu docstring linked `:attr:`flet.Page.browser_context_menu``, which this PR removes — leaving an unresolved reST xref that failed the docs build's cross-reference check (`docs/controls/contextmenu`). Point it at the `BrowserContextMenu` service directly. Verified locally with the full `yarn build` + `check_docs` sequence — all checks pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares Flet for a deprecation-free 1.0 by removing every deprecated API from shipping source — both the version-scheduled deprecations (0.88 → 1.0) and the ones that had no scheduled removal. A multi-agent audit across all 24 Python and 19 Dart packages confirms zero active deprecations remain.
Removed
Controls & events
DragTargetEvent.x/.y/.offset→ uselocal_position/global_positionConstrainedControl→ inherit fromLayoutControlElevatedButton→ useButtonVideo.show_controls(→controls=None),Video.playlist_add()/playlist_remove()(→ mutateVideo.playlist)Page
Page.go()→Page.push_route()Page.url_launcher/browser_context_menu/shared_preferences/clipboard/storage_paths→ instantiate the service classes directly (UrlLauncher(), etc.)Page.launch_url()/can_launch_url()/close_in_app_web_view()→UrlLauncher().*App entry
app()/app_async()→run()/run_async()run(target=...)/run_async(target=...)→ passmainFletApp.show_app_startup_screen/app_startup_screen_message→boot_screen_optionsColors — 14 non-underscored aliases (
BLACK12…WHITE70) → underscored names (Colors.BLACK_12);Colorsreverted to a plainEnumCLI / build
--clear-cacheflag offlet build/flet debug→flet clean[tool.flet.app.boot_screen]/[tool.flet.app.startup_screen]config →[tool.flet.boot_screen]Dart — empty-string (
"") widget-state key back-compat → use"default"Notes
DropdownM2is kept and un-deprecated — its 0.84.0 deprecation in favor ofDropdownis reverted; it remains a supported control.page.launch_url()toft.UrlLauncher().flet_mapexamples:SimpleAttribution.on_click=lambda e: <async launch_url>never awaited the coroutine (click did nothing) → replaced with properasync defhandlers.All of the above are breaking. See the
## 1.0.0section ofCHANGELOG.mdand the updated 0.85.0 / 0.86.0 migration guides.Summary by Sourcery
Remove all previously deprecated public APIs across Python, Dart, CLI, and video packages in preparation for a deprecation-free 1.0 release.
Bug Fixes:
Enhancements:
Documentation: