From 0727bddce4a54ed57146ca29ab248a90eb7a5a79 Mon Sep 17 00:00:00 2001 From: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com> Date: Tue, 3 Dec 2024 22:11:32 +0100 Subject: [PATCH 1/5] feat: implement `Window.ignore_mouse_events` (#4465) --- packages/flet/lib/src/controls/page.dart | 10 ++++++++++ packages/flet/lib/src/utils/desktop.dart | 7 +++++++ sdk/python/packages/flet/src/flet/core/page.py | 11 +++++++++++ 3 files changed, 28 insertions(+) diff --git a/packages/flet/lib/src/controls/page.dart b/packages/flet/lib/src/controls/page.dart index d26f530f6..d80f19680 100644 --- a/packages/flet/lib/src/controls/page.dart +++ b/packages/flet/lib/src/controls/page.dart @@ -167,6 +167,7 @@ class _PageControlState extends State with FletStoreMixin { bool? _windowTitleBarHidden; bool? _windowSkipTaskBar; double? _windowProgressBar; + bool? _windowIgnoreMouseEvents; final _navigatorKey = GlobalKey(); late final RouteState _routeState; late final SimpleRouterDelegate _routerDelegate; @@ -338,6 +339,8 @@ class _PageControlState extends State with FletStoreMixin { var windowSkipTaskBar = widget.control.attrBool("windowSkipTaskBar"); var windowFrameless = widget.control.attrBool("windowFrameless"); var windowProgressBar = widget.control.attrDouble("windowProgressBar"); + var windowIgnoreMouseEvents = + widget.control.attrBool("windowIgnoreMouseEvents"); updateWindow(PageArgsModel? pageArgs) async { try { @@ -580,6 +583,13 @@ class _PageControlState extends State with FletStoreMixin { if (windowWaitUntilReadyToShow == true) { await waitUntilReadyToShow(); } + + // windowIgnoreMouseEvents + if (windowIgnoreMouseEvents != null && + windowIgnoreMouseEvents != _windowIgnoreMouseEvents) { + await setIgnoreMouseEvents(windowIgnoreMouseEvents); + _windowIgnoreMouseEvents = windowIgnoreMouseEvents; + } } catch (e) { debugPrint("ERROR updating window: $e"); } diff --git a/packages/flet/lib/src/utils/desktop.dart b/packages/flet/lib/src/utils/desktop.dart index 9f0ec4115..981e2c972 100644 --- a/packages/flet/lib/src/utils/desktop.dart +++ b/packages/flet/lib/src/utils/desktop.dart @@ -283,6 +283,13 @@ Future isFocused() async { } } +Future setIgnoreMouseEvents(bool ignore) async { + if (isDesktopPlatform()) { + debugPrint("setIgnoreMouseEvents($ignore)"); + await windowManager.setIgnoreMouseEvents(ignore); + } +} + Future getWindowMediaData() async { var m = WindowMediaData(); if (isDesktopPlatform()) { diff --git a/sdk/python/packages/flet/src/flet/core/page.py b/sdk/python/packages/flet/src/flet/core/page.py index 0714f07e2..72bd54027 100644 --- a/sdk/python/packages/flet/src/flet/core/page.py +++ b/sdk/python/packages/flet/src/flet/core/page.py @@ -476,6 +476,17 @@ def icon(self) -> Optional[str]: def icon(self, value: Optional[str]): self.page._set_attr("windowIcon", value) + # ignore_mouse_events + @property + def ignore_mouse_events(self) -> bool: + return self.page._get_attr( + "windowIgnoreMouseEvents", data_type="bool", def_value=False + ) + + @ignore_mouse_events.setter + def ignore_mouse_events(self, value: Optional[bool]): + self.page._set_attr("windowIgnoreMouseEvents", value) + # Methods def destroy(self): self.page._set_attr("windowDestroy", True) From d5fe9c54f98aea0532ceed2887babd36f795be61 Mon Sep 17 00:00:00 2001 From: Osama Mohammed Al-zabidi <57198110+omamkaz@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:14:48 +0300 Subject: [PATCH 2/5] Update project_dependencies.py (#4459) # `Fixed` when I get no markers key in the version_value variable. ```bash Traceback (most recent call last): File "/opt/hostedtoolcache/Python/3.12.5/x64/bin/flet", line 8, in sys.exit(main()) ^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet/cli.py", line 12, in main flet_cli.cli.main() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/cli.py", line 89, in main args.handler(args) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 557, in handle self.package_python_app() File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/commands/build.py", line 1303, in package_python_app toml_dependencies = get_poetry_dependencies( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 41, in get_poetry_dependencies format_dependency_version(dependency, version) File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/flet_cli/utils/project_dependencies.py", line 21, in format_dependency_version if version_value["markers"]: ~~~~~~~~~~~~~^^^^^^^^^^^ KeyError: 'markers' ``` --- .../flet-cli/src/flet_cli/utils/project_dependencies.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/python/packages/flet-cli/src/flet_cli/utils/project_dependencies.py b/sdk/python/packages/flet-cli/src/flet_cli/utils/project_dependencies.py index 756a68356..218705576 100644 --- a/sdk/python/packages/flet-cli/src/flet_cli/utils/project_dependencies.py +++ b/sdk/python/packages/flet-cli/src/flet_cli/utils/project_dependencies.py @@ -18,8 +18,9 @@ def format_dependency_version(dependency: str, version_value: Any): suffix = "" if isinstance(version_value, dict): version = version_value["version"] - if version_value["markers"]: - suffix = f";{version_value['markers']}" + markers = version_value.get("markers") + if markers is not None: + suffix = f";{markers}" else: version = version_value From 07bb136cd84dfb194a55021b1773b170c7347d79 Mon Sep 17 00:00:00 2001 From: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com> Date: Tue, 3 Dec 2024 22:22:25 +0100 Subject: [PATCH 3/5] Remove `v0.26.0` deprecations (#4479) * delete deprecations on py end * delete deprecations on dart end --- .../flet/lib/src/controls/circle_avatar.dart | 7 +- .../lib/src/controls/popup_menu_button.dart | 1 - sdk/python/packages/flet/src/flet/__init__.py | 5 +- .../packages/flet/src/flet/core/audio.py | 40 - .../flet/src/flet/core/audio_recorder.py | 24 - .../flet/src/flet/core/canvas/canvas.py | 6 - .../flet/src/flet/core/circle_avatar.py | 44 - .../packages/flet/src/flet/core/column.py | 8 - .../packages/flet/src/flet/core/control.py | 6 - .../flet/src/flet/core/date_picker.py | 17 - .../flet/src/flet/core/dismissible.py | 8 - .../flet/src/flet/core/drag_target.py | 15 - .../packages/flet/src/flet/core/dropdown.py | 8 - .../flet/src/flet/core/elevated_button.py | 8 - .../flet/src/flet/core/file_picker.py | 58 - .../packages/flet/src/flet/core/grid_view.py | 8 - .../flet/src/flet/core/haptic_feedback.py | 32 - .../flet/src/flet/core/icon_button.py | 8 - .../packages/flet/src/flet/core/list_view.py | 8 - .../flet/src/flet/core/menu_item_button.py | 8 - .../flet/src/flet/core/navigation_bar.py | 37 - .../flet/src/flet/core/outlined_button.py | 8 - .../packages/flet/src/flet/core/page.py | 1093 ----------------- .../packages/flet/src/flet/core/pagelet.py | 32 - .../flet/src/flet/core/popup_menu_button.py | 22 - .../src/flet/core/pubsub/pubsub_client.py | 72 -- .../flet/src/flet/core/responsive_row.py | 8 - sdk/python/packages/flet/src/flet/core/row.py | 8 - .../packages/flet/src/flet/core/safe_area.py | 22 - .../flet/src/flet/core/scrollable_control.py | 15 - .../packages/flet/src/flet/core/search_bar.py | 16 - .../flet/src/flet/core/submenu_button.py | 8 - .../flet/src/flet/core/text_button.py | 8 - .../packages/flet/src/flet/core/textfield.py | 8 - .../flet/src/flet/core/time_picker.py | 17 - .../packages/flet/src/flet/core/types.py | 34 - .../flet/src/flet/core/user_control.py | 15 - .../packages/flet/src/flet/core/video.py | 84 -- 38 files changed, 3 insertions(+), 1823 deletions(-) delete mode 100644 sdk/python/packages/flet/src/flet/core/user_control.py diff --git a/packages/flet/lib/src/controls/circle_avatar.dart b/packages/flet/lib/src/controls/circle_avatar.dart index 11a6b798b..8dd1e25ae 100644 --- a/packages/flet/lib/src/controls/circle_avatar.dart +++ b/packages/flet/lib/src/controls/circle_avatar.dart @@ -27,11 +27,8 @@ class CircleAvatarControl extends StatelessWidget with FletStoreMixin { bool disabled = control.isDisabled || parentDisabled; return withPageArgs((context, pageArgs) { - // DEPRECATED: foregroundImageUrl and backgroundImageUrl - var foregroundImageSrc = control.attrString("foregroundImageSrc") ?? - control.attrString("foregroundImageUrl"); - var backgroundImageSrc = control.attrString("backgroundImageSrc") ?? - control.attrString("backgroundImageUrl"); + var foregroundImageSrc = control.attrString("foregroundImageSrc"); + var backgroundImageSrc = control.attrString("backgroundImageSrc"); var contentCtrls = children.where((c) => c.name == "content" && c.isVisible); diff --git a/packages/flet/lib/src/controls/popup_menu_button.dart b/packages/flet/lib/src/controls/popup_menu_button.dart index e552220fe..8f82b6f73 100644 --- a/packages/flet/lib/src/controls/popup_menu_button.dart +++ b/packages/flet/lib/src/controls/popup_menu_button.dart @@ -76,7 +76,6 @@ class PopupMenuButtonControl extends StatelessWidget with FletStoreMixin { }, onCanceled: () { backend.triggerControlEvent(control.id, "cancel"); - backend.triggerControlEvent(control.id, "cancelled"); // DEPRECATED }, onOpened: () { backend.triggerControlEvent(control.id, "open"); diff --git a/sdk/python/packages/flet/src/flet/__init__.py b/sdk/python/packages/flet/src/flet/__init__.py index 15ab2bfea..c2c6d9870 100644 --- a/sdk/python/packages/flet/src/flet/__init__.py +++ b/sdk/python/packages/flet/src/flet/__init__.py @@ -151,7 +151,7 @@ DismissibleUpdateEvent, ) from flet.core.divider import Divider -from flet.core.drag_target import DragTarget, DragTargetAcceptEvent +from flet.core.drag_target import DragTarget, DragTargetEvent from flet.core.draggable import Draggable from flet.core.dropdown import Dropdown from flet.core.elevated_button import ElevatedButton @@ -239,7 +239,6 @@ NavigationBar, NavigationBarDestination, NavigationBarLabelBehavior, - NavigationDestination, ) from flet.core.navigation_drawer import ( NavigationDrawer, @@ -405,7 +404,6 @@ Locale, LocaleConfiguration, MainAxisAlignment, - MaterialState, MouseCursor, NotchShape, Number, @@ -427,7 +425,6 @@ VisualDensity, WebRenderer, ) -from flet.core.user_control import UserControl from flet.core.vertical_divider import VerticalDivider from flet.core.video import ( PlaylistMode, diff --git a/sdk/python/packages/flet/src/flet/core/audio.py b/sdk/python/packages/flet/src/flet/core/audio.py index d6c68bf84..077ccf63b 100644 --- a/sdk/python/packages/flet/src/flet/core/audio.py +++ b/sdk/python/packages/flet/src/flet/core/audio.py @@ -127,58 +127,18 @@ def _get_control_name(self): def play(self): self.invoke_method("play") - @deprecated( - reason="Use play() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def play_async(self): - self.play() - def pause(self): self.invoke_method("pause") - @deprecated( - reason="Use pause() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def pause_async(self): - self.pause() - def resume(self): self.invoke_method("resume") - @deprecated( - reason="Use resume() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def resume_async(self): - self.resume() - def release(self): self.invoke_method("release") - @deprecated( - reason="Use release() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def release_async(self): - self.release() - def seek(self, position_milliseconds: int): self.invoke_method("seek", {"position": str(position_milliseconds)}) - @deprecated( - reason="Use seek() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def seek_async(self, position_milliseconds: int): - self.seek(position_milliseconds) - def get_duration(self, wait_timeout: Optional[float] = 5) -> Optional[int]: sr = self.invoke_method( "get_duration", diff --git a/sdk/python/packages/flet/src/flet/core/audio_recorder.py b/sdk/python/packages/flet/src/flet/core/audio_recorder.py index b092201da..6def0be56 100644 --- a/sdk/python/packages/flet/src/flet/core/audio_recorder.py +++ b/sdk/python/packages/flet/src/flet/core/audio_recorder.py @@ -95,14 +95,6 @@ def start_recording( ) return started == "true" - @deprecated( - reason="Use start_recording() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def start_recording_async(self, output_path: str) -> bool: - return self.start_recording(output_path) - def is_recording(self, wait_timeout: Optional[float] = 5) -> bool: recording = self.invoke_method( "is_recording", @@ -145,25 +137,9 @@ def cancel_recording(self, wait_timeout: Optional[float] = 5) -> None: def resume_recording(self): self.invoke_method("resume_recording") - @deprecated( - reason="Use resume_recording() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def resume_recording_async(self): - self.resume_recording() - def pause_recording(self): self.invoke_method("pause_recording") - @deprecated( - reason="Use pause_recording() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def pause_recording_async(self): - self.pause_recording() - def is_paused(self, wait_timeout: Optional[float] = 5) -> bool: paused = self.invoke_method( "is_paused", diff --git a/sdk/python/packages/flet/src/flet/core/canvas/canvas.py b/sdk/python/packages/flet/src/flet/core/canvas/canvas.py index 67528c2a2..82fd5fa96 100644 --- a/sdk/python/packages/flet/src/flet/core/canvas/canvas.py +++ b/sdk/python/packages/flet/src/flet/core/canvas/canvas.py @@ -107,12 +107,6 @@ def clean(self): super().clean() self.__shapes.clear() - @deprecated( - reason="Use clean() method instead.", version="0.21.0", delete_version="0.26.0" - ) - async def clean_async(self): - self.clean() - # shapes @property def shapes(self) -> List[Shape]: diff --git a/sdk/python/packages/flet/src/flet/core/circle_avatar.py b/sdk/python/packages/flet/src/flet/core/circle_avatar.py index 76635396b..1cb6e86d4 100644 --- a/sdk/python/packages/flet/src/flet/core/circle_avatar.py +++ b/sdk/python/packages/flet/src/flet/core/circle_avatar.py @@ -173,50 +173,6 @@ def _get_children(self): return [self.__content] return [] - # foreground_image_url - @property - def foreground_image_url(self) -> Optional[str]: - warnings.warn( - f"foreground_image_url is deprecated since version 0.22.0 " - f"and will be removed in version 0.26.0. Use foreground_image_src instead.", - category=DeprecationWarning, - stacklevel=2, - ) - return self._get_attr("foregroundImageUrl") - - @foreground_image_url.setter - def foreground_image_url(self, value: Optional[str]): - self._set_attr("foregroundImageUrl", value) - if value is not None: - warnings.warn( - f"foreground_image_url is deprecated since version 0.22.0 " - f"and will be removed in version 0.26.0. Use foreground_image_src instead.", - category=DeprecationWarning, - stacklevel=2, - ) - - # background_image_url - @property - def background_image_url(self) -> Optional[str]: - warnings.warn( - f"background_image_url is deprecated since version 0.22.0 " - f"and will be removed in version 0.26.0. Use background_image_src instead.", - category=DeprecationWarning, - stacklevel=2, - ) - return self._get_attr("backgroundImageUrl") - - @background_image_url.setter - def background_image_url(self, value: Optional[str]): - self._set_attr("backgroundImageUrl", value) - if value is not None: - warnings.warn( - f"background_image_url is deprecated since version 0.22.0 " - f"and will be removed in version 0.26.0. Use background_image_src instead.", - category=DeprecationWarning, - stacklevel=2, - ) - # foreground_image_src @property def foreground_image_src(self) -> Optional[str]: diff --git a/sdk/python/packages/flet/src/flet/core/column.py b/sdk/python/packages/flet/src/flet/core/column.py index 9d1a24595..c801c4054 100644 --- a/sdk/python/packages/flet/src/flet/core/column.py +++ b/sdk/python/packages/flet/src/flet/core/column.py @@ -167,14 +167,6 @@ def clean(self): super().clean() self.__controls.clear() - @deprecated( - reason="Use clean() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def clean_async(self): - self.clean() - # tight @property def tight(self) -> bool: diff --git a/sdk/python/packages/flet/src/flet/core/control.py b/sdk/python/packages/flet/src/flet/core/control.py index 142bb31ba..a7bd44323 100644 --- a/sdk/python/packages/flet/src/flet/core/control.py +++ b/sdk/python/packages/flet/src/flet/core/control.py @@ -335,12 +335,6 @@ def clean(self) -> None: ), f"{self.__class__.__qualname__} Control must be added to the page" self.__page._clean(self) - @deprecated( - reason="Use clean() method instead.", version="0.21.0", delete_version="0.26.0" - ) - async def clean_async(self): - self.clean() - def invoke_method( self, method_name: str, diff --git a/sdk/python/packages/flet/src/flet/core/date_picker.py b/sdk/python/packages/flet/src/flet/core/date_picker.py index 577460e46..ea9ac55d2 100644 --- a/sdk/python/packages/flet/src/flet/core/date_picker.py +++ b/sdk/python/packages/flet/src/flet/core/date_picker.py @@ -173,23 +173,6 @@ def __init__( def _get_control_name(self): return "datepicker" - @deprecated( - reason="Use Page.open() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def pick_date(self): - self.open = True - self.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def pick_date_async(self): - self.pick_date() - # open @property def open(self) -> bool: diff --git a/sdk/python/packages/flet/src/flet/core/dismissible.py b/sdk/python/packages/flet/src/flet/core/dismissible.py index 6444d681f..2fb8b1e9c 100644 --- a/sdk/python/packages/flet/src/flet/core/dismissible.py +++ b/sdk/python/packages/flet/src/flet/core/dismissible.py @@ -164,14 +164,6 @@ def before_update(self): def confirm_dismiss(self, dismiss: bool): self.invoke_method("confirm_dismiss", {"dismiss": str(dismiss).lower()}) - @deprecated( - reason="Use confirm_dismiss() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def confirm_dismiss_async(self, dismiss: bool): - self.confirm_dismiss(dismiss) - # content @property def content(self) -> Control: diff --git a/sdk/python/packages/flet/src/flet/core/drag_target.py b/sdk/python/packages/flet/src/flet/core/drag_target.py index 29252ecc4..67a80dea3 100644 --- a/sdk/python/packages/flet/src/flet/core/drag_target.py +++ b/sdk/python/packages/flet/src/flet/core/drag_target.py @@ -206,21 +206,6 @@ def on_move(self, handler: OptionalEventCallable["DragTargetEvent"]): self.__on_move.handler = handler -class DragTargetAcceptEvent(ControlEvent): - def __init__(self, e: ControlEvent): - super().__init__(e.target, e.name, e.data, e.control, e.page) - d = json.loads(e.data) - warn( - f"{self.__class__.__name__} is deprecated since version 0.22.0 " - f"and will be removed in version 0.26.0. Use DragTargetEvent instead.", - category=DeprecationWarning, - stacklevel=2, - ) - self.src_id: float = d.get("src_id") - self.x: float = d.get("x") - self.y: float = d.get("y") - - class DragTargetEvent(ControlEvent): def __init__(self, e: ControlEvent): super().__init__(e.target, e.name, e.data, e.control, e.page) diff --git a/sdk/python/packages/flet/src/flet/core/dropdown.py b/sdk/python/packages/flet/src/flet/core/dropdown.py index 859b41bf4..bd78e168a 100644 --- a/sdk/python/packages/flet/src/flet/core/dropdown.py +++ b/sdk/python/packages/flet/src/flet/core/dropdown.py @@ -408,14 +408,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # options @property def options(self): diff --git a/sdk/python/packages/flet/src/flet/core/elevated_button.py b/sdk/python/packages/flet/src/flet/core/elevated_button.py index 20f460f55..a28feba65 100644 --- a/sdk/python/packages/flet/src/flet/core/elevated_button.py +++ b/sdk/python/packages/flet/src/flet/core/elevated_button.py @@ -184,14 +184,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # text @property def text(self) -> Optional[str]: diff --git a/sdk/python/packages/flet/src/flet/core/file_picker.py b/sdk/python/packages/flet/src/flet/core/file_picker.py index 38d9f6773..42bc3a3b7 100644 --- a/sdk/python/packages/flet/src/flet/core/file_picker.py +++ b/sdk/python/packages/flet/src/flet/core/file_picker.py @@ -170,27 +170,6 @@ def pick_files( self.allow_multiple = allow_multiple self.update() - @deprecated( - reason="Use pick_files() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def pick_files_async( - self, - dialog_title: Optional[str] = None, - initial_directory: Optional[str] = None, - file_type: FilePickerFileType = FilePickerFileType.ANY, - allowed_extensions: Optional[List[str]] = None, - allow_multiple: Optional[bool] = False, - ): - self.pick_files( - dialog_title, - initial_directory, - file_type, - allowed_extensions, - allow_multiple, - ) - def save_file( self, dialog_title: Optional[str] = None, @@ -207,23 +186,6 @@ def save_file( self.allowed_extensions = allowed_extensions self.update() - @deprecated( - reason="Use save_file() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def save_file_async( - self, - dialog_title: Optional[str] = None, - file_name: Optional[str] = None, - initial_directory: Optional[str] = None, - file_type: FilePickerFileType = FilePickerFileType.ANY, - allowed_extensions: Optional[List[str]] = None, - ): - self.save_file( - dialog_title, file_name, initial_directory, file_type, allowed_extensions - ) - def get_directory_path( self, dialog_title: Optional[str] = None, @@ -234,30 +196,10 @@ def get_directory_path( self.initial_directory = initial_directory self.update() - @deprecated( - reason="Use get_directory_path() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def get_directory_path_async( - self, - dialog_title: Optional[str] = None, - initial_directory: Optional[str] = None, - ): - self.get_directory_path(dialog_title, initial_directory) - def upload(self, files: List[FilePickerUploadFile]): self.__upload = files self.update() - @deprecated( - reason="Use upload() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def upload_async(self, files: List[FilePickerUploadFile]): - self.upload(files) - # state @property def state(self) -> Optional[FilePickerState]: diff --git a/sdk/python/packages/flet/src/flet/core/grid_view.py b/sdk/python/packages/flet/src/flet/core/grid_view.py index 6aeaed5f8..7b8e7eb69 100644 --- a/sdk/python/packages/flet/src/flet/core/grid_view.py +++ b/sdk/python/packages/flet/src/flet/core/grid_view.py @@ -189,14 +189,6 @@ def clean(self): super().clean() self.__controls.clear() - @deprecated( - reason="Use clean() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def clean_async(self): - self.clean() - # horizontal @property def horizontal(self) -> bool: diff --git a/sdk/python/packages/flet/src/flet/core/haptic_feedback.py b/sdk/python/packages/flet/src/flet/core/haptic_feedback.py index c536767e3..b49d9ec7f 100644 --- a/sdk/python/packages/flet/src/flet/core/haptic_feedback.py +++ b/sdk/python/packages/flet/src/flet/core/haptic_feedback.py @@ -54,43 +54,11 @@ def is_isolated(self): def heavy_impact(self): self.invoke_method("heavy_impact") - @deprecated( - reason="Use heavy_impact() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def heavy_impact_async(self): - self.heavy_impact() - def light_impact(self): self.invoke_method("light_impact") - @deprecated( - reason="Use light_impact() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def light_impact_async(self): - self.light_impact() - def medium_impact(self): self.invoke_method("medium_impact") - @deprecated( - reason="Use medium_impact() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def medium_impact_async(self): - self.medium_impact() - def vibrate(self): self.invoke_method("vibrate") - - @deprecated( - reason="Use vibrate() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def vibrate_async(self): - self.vibrate() diff --git a/sdk/python/packages/flet/src/flet/core/icon_button.py b/sdk/python/packages/flet/src/flet/core/icon_button.py index 8b72c25c0..7330697ec 100644 --- a/sdk/python/packages/flet/src/flet/core/icon_button.py +++ b/sdk/python/packages/flet/src/flet/core/icon_button.py @@ -216,14 +216,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # icon @property def icon(self) -> Optional[IconValue]: diff --git a/sdk/python/packages/flet/src/flet/core/list_view.py b/sdk/python/packages/flet/src/flet/core/list_view.py index 33fae5120..f84de96ea 100644 --- a/sdk/python/packages/flet/src/flet/core/list_view.py +++ b/sdk/python/packages/flet/src/flet/core/list_view.py @@ -176,14 +176,6 @@ def clean(self): super().clean() self.__controls.clear() - @deprecated( - reason="Use clean() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def clean_async(self): - self.clean() - # horizontal @property def horizontal(self) -> bool: diff --git a/sdk/python/packages/flet/src/flet/core/menu_item_button.py b/sdk/python/packages/flet/src/flet/core/menu_item_button.py index 3798491ab..785b384b8 100644 --- a/sdk/python/packages/flet/src/flet/core/menu_item_button.py +++ b/sdk/python/packages/flet/src/flet/core/menu_item_button.py @@ -152,14 +152,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # focus_on_hover @property def focus_on_hover(self) -> bool: diff --git a/sdk/python/packages/flet/src/flet/core/navigation_bar.py b/sdk/python/packages/flet/src/flet/core/navigation_bar.py index cf59bb95c..3806c8e54 100644 --- a/sdk/python/packages/flet/src/flet/core/navigation_bar.py +++ b/sdk/python/packages/flet/src/flet/core/navigation_bar.py @@ -191,43 +191,6 @@ def tooltip(self, value: Optional[str]): self._set_attr("tooltip", value) -@deprecated( - reason="Use NavigationBarDestination class instead.", - version="0.23.0", - delete_version="0.26.0", -) -class NavigationDestination(NavigationBarDestination): - def __init__( - self, - label: Optional[str] = None, - icon: Optional[IconValueOrControl] = None, - icon_content: Optional[Control] = None, - selected_icon: Optional[IconValueOrControl] = None, - selected_icon_content: Optional[Control] = None, - bgcolor: Optional[ColorValue] = None, - # - # Control - # - ref: Optional[Ref] = None, - tooltip: TooltipValue = None, - disabled: Optional[bool] = None, - data: Any = None, - ) -> None: - NavigationBarDestination.__init__( - self, - label, - icon, - icon_content, - selected_icon, - selected_icon_content, - bgcolor, - ref, - tooltip, - disabled, - data, - ) - - class NavigationBar(ConstrainedControl, AdaptiveControl): """ Material 3 Navigation Bar component. diff --git a/sdk/python/packages/flet/src/flet/core/outlined_button.py b/sdk/python/packages/flet/src/flet/core/outlined_button.py index 17ba684d8..5c076b23c 100644 --- a/sdk/python/packages/flet/src/flet/core/outlined_button.py +++ b/sdk/python/packages/flet/src/flet/core/outlined_button.py @@ -169,14 +169,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # text @property def text(self) -> Optional[str]: diff --git a/sdk/python/packages/flet/src/flet/core/page.py b/sdk/python/packages/flet/src/flet/core/page.py index 72bd54027..b59c73b84 100644 --- a/sdk/python/packages/flet/src/flet/core/page.py +++ b/sdk/python/packages/flet/src/flet/core/page.py @@ -734,28 +734,12 @@ def update(self, *controls) -> None: r = self.__update(*controls) self.__handle_mount_unmount(*r) - @deprecated( - reason="Use Page.update() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def update_async(self, *controls): - self.update(*controls) - def add(self, *controls: Control) -> None: with self.__lock: self._controls.extend(controls) r = self.__update(self) self.__handle_mount_unmount(*r) - @deprecated( - reason="Use Page.add() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def add_async(self, *controls): - self.add(*controls) - def insert(self, at: int, *controls: Control) -> None: with self.__lock: n = at @@ -765,14 +749,6 @@ def insert(self, at: int, *controls: Control) -> None: r = self.__update(self) self.__handle_mount_unmount(*r) - @deprecated( - reason="Use Page.insert() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def insert_async(self, at, *controls): - self.insert(at, *controls) - def remove(self, *controls: Control) -> None: with self.__lock: for control in controls: @@ -780,40 +756,16 @@ def remove(self, *controls: Control) -> None: r = self.__update(self) self.__handle_mount_unmount(*r) - @deprecated( - reason="Use Page.remove() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def remove_async(self, *controls): - self.remove(*controls) - def remove_at(self, index: int) -> None: with self.__lock: self._controls.pop(index) r = self.__update(self) self.__handle_mount_unmount(*r) - @deprecated( - reason="Use Page.remove_at() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def remove_at_async(self, index): - self.remove_at(index) - def clean(self) -> None: self._clean(self) self._controls.clear() - @deprecated( - reason="Use Page.clean() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def clean_async(self): - self.clean() - def _clean(self, control: Control) -> None: with self.__lock: control._previous_children.clear() @@ -897,14 +849,6 @@ def error(self, message: str = "") -> None: with self.__lock: self._send_command("error", [message]) - @deprecated( - reason="Use Page.error() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def error_async(self, message=""): - self.error(message) - async def on_event_async(self, e: Event) -> None: logger.debug(f"page.on_event_async: {e.target} {e.name} {e.data}") @@ -996,14 +940,6 @@ def go( self.update() self.query() # Update query url (required when using go) - @deprecated( - reason="Use Page.go() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def go_async(self, route, skip_route_change_event=False, **kwargs): - self.go(route, skip_route_change_event, **kwargs) - def get_upload_url(self, file_name: str, expires: int) -> str: r = self._send_command( "getUploadUrl", attrs={"file": file_name, "expires": str(expires)} @@ -1012,14 +948,6 @@ def get_upload_url(self, file_name: str, expires: int) -> str: raise Exception(r.error) return r.result - @deprecated( - reason="Use Page.get_upload_url() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def get_upload_url_async(self, file_name: str, expires: int): - return self.get_upload_url(file_name, expires) - def login( self, provider: OAuthProvider, @@ -1176,14 +1104,6 @@ def logout(self) -> None: ), ) - @deprecated( - reason="Use Page.logout() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def logout_async(self): - self.logout() - def _send_command( self, name: str, @@ -1203,14 +1123,6 @@ def _send_command( def set_clipboard(self, value: str, wait_timeout: Optional[float] = 10) -> None: self._invoke_method("setClipboard", {"data": value}, wait_timeout=wait_timeout) - @deprecated( - reason="Use Page.set_clipboard() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def set_clipboard_async(self, value: str, wait_timeout: Optional[float] = 10): - self.set_clipboard(value, wait_timeout=wait_timeout) - def get_clipboard(self, wait_timeout: Optional[float] = 10) -> Optional[str]: return self._invoke_method( "getClipboard", wait_for_result=True, wait_timeout=wait_timeout @@ -1242,23 +1154,6 @@ def launch_url( args["window_height"] = str(window_height) self._invoke_method("launchUrl", args) - @deprecated( - reason="Use Page.launch_url() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def launch_url_async( - self, - url: str, - web_window_name: Optional[str] = None, - web_popup_window: bool = False, - window_width: Optional[int] = None, - window_height: Optional[int] = None, - ): - self.launch_url( - url, web_window_name, web_popup_window, window_width, window_height - ) - def can_launch_url(self, url: str) -> bool: args = {"url": url} return self._invoke_method("canLaunchUrl", args, wait_for_result=True) == "true" @@ -1273,30 +1168,6 @@ async def can_launch_url_async(self, url: str) -> bool: def close_in_app_web_view(self) -> None: self._invoke_method("closeInAppWebView") - @deprecated( - reason="Use Page.close_in_app_web_view() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_in_app_web_view_async(self): - self.close_in_app_web_view() - - @deprecated( - reason="Use Page.window.to_front() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - def window_to_front(self) -> None: - self.__window.to_front() - - @deprecated( - reason="Use Page.window.to_front() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def window_to_front_async(self): - self.__window.to_front() - def scroll_to( self, offset: Optional[float] = None, @@ -1309,21 +1180,6 @@ def scroll_to( offset=offset, delta=delta, key=key, duration=duration, curve=curve ) - @deprecated( - reason="Use Page.scroll_to() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def scroll_to_async( - self, - offset: Optional[float] = None, - delta: Optional[float] = None, - key: Optional[str] = None, - duration: Optional[int] = None, - curve: Optional[AnimationCurve] = None, - ): - self.scroll_to(offset, delta, key, duration, curve) - def _invoke_method( self, method_name: str, @@ -1449,271 +1305,6 @@ def close(control: Control) -> None: else: raise ValueError(f"{control.__class__.__qualname__} has no open attribute") - # - # SnackBar - # - @deprecated( - reason="Use Page.open() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def show_snack_bar(self, snack_bar: SnackBar): - self.__offstage.snack_bar = snack_bar - self.__offstage.snack_bar.open = True - self.__offstage.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_snack_bar_async(self, snack_bar: SnackBar): - self.show_snack_bar(snack_bar) - - # - # Dialogs - # - @deprecated( - reason="Use Page.open() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def show_dialog(self, dialog: Union[AlertDialog, CupertinoAlertDialog]): - self.__offstage.dialog = dialog - self.__offstage.dialog.open = True - self.__offstage.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_dialog_async(self, dialog: Union[AlertDialog, CupertinoAlertDialog]): - self.show_dialog(dialog) - - @deprecated( - reason="Use Page.close() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def close_dialog(self): - if self.__offstage.dialog is not None: - self.__offstage.dialog.open = False - self.__offstage.update() - - @deprecated( - reason="Use Page.close() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_dialog_async(self): - self.close_dialog() - - # - # Banner - # - @deprecated( - reason="Use Page.open() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def show_banner(self, banner: Banner): - self.__offstage.banner = banner - self.__offstage.banner.open = True - self.__offstage.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_banner_async(self, banner: Banner): - self.show_banner(banner) - - @deprecated( - reason="Use Page.close() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def close_banner(self): - if self.__offstage.banner is not None: - self.__offstage.banner.open = False - self.__offstage.update() - - @deprecated( - reason="Use Page.close() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_banner_async(self): - self.close_banner() - - # - # BottomSheet - # - @deprecated( - reason="Use Page.open() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def show_bottom_sheet( - self, - bottom_sheet: Union[BottomSheet, CupertinoBottomSheet], - ): - self.__offstage.bottom_sheet = bottom_sheet - self.__offstage.bottom_sheet.open = True - self.__offstage.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_bottom_sheet_async( - self, - bottom_sheet: Union[BottomSheet, CupertinoBottomSheet], - ): - self.show_bottom_sheet(bottom_sheet) - - @deprecated( - reason="Use Page.close() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def close_bottom_sheet(self): - if self.__offstage.bottom_sheet is not None: - self.__offstage.bottom_sheet.open = False - self.__offstage.update() - - @deprecated( - reason="Use Page.close() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_bottom_sheet_async(self): - self.close_bottom_sheet() - - # - # Drawer - # - @deprecated( - reason="Use Page.close() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def show_drawer(self, drawer: NavigationDrawer): - self.drawer = drawer - self.drawer.open = True - self.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_drawer_async(self, drawer: NavigationDrawer): - self.show_drawer(drawer) - - @deprecated( - reason="Use Page.close() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def close_drawer(self): - if self.drawer is not None: - self.drawer.open = False - self.update() - - @deprecated( - reason="Use Page.close() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_drawer_async(self): - self.close_drawer() - - # - # End_drawer - # - @deprecated( - reason="Use Page.close() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def show_end_drawer(self, end_drawer: NavigationDrawer): - self.end_drawer = end_drawer - self.end_drawer.open = True - self.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_end_drawer_async(self, end_drawer: NavigationDrawer): - self.show_end_drawer(end_drawer) - - def close_end_drawer(self): - if self.end_drawer is not None: - self.end_drawer.open = False - self.update() - - @deprecated( - reason="Use Page.close() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_end_drawer_async(self): - self.close_end_drawer() - - @deprecated( - reason="Use Page.window.destroy() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def window_destroy(self) -> None: - self.__window.destroy() - - @deprecated( - reason="Use Page.window.destroy() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def window_destroy_async(self): - self.__window.destroy() - - @deprecated( - reason="Use Page.window.center() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def window_center(self) -> None: - self.__window.center() - - @deprecated( - reason="Use Page.window.center() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def window_center_async(self): - self.__window.center() - - @deprecated( - reason="Use Page.window.close() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def window_close(self) -> None: - self.__window.close() - - @deprecated( - reason="Use Page.window.close() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def window_close_async(self): - self.__window.close() - # query @property def query(self) -> QueryString: @@ -2043,81 +1634,6 @@ def client_storage(self) -> ClientStorage: def session(self) -> SessionStorage: return self.__session_storage - # splash - @property - def splash(self) -> Optional[Control]: - return self.__offstage.splash - - @splash.setter - @deprecated( - reason="Use Page.overlay.append(splash) method instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def splash(self, value: Optional[Control]): - self.__offstage.splash = value - - # banner - @property - def banner(self) -> Optional[Banner]: - return self.__offstage.banner - - @banner.setter - @deprecated( - reason="Use Page.overlay.append(banner) instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def banner(self, value: Optional[Banner]): - self.__offstage.banner = value - - # snack_bar - @property - def snack_bar(self) -> Optional[SnackBar]: - return self.__offstage.snack_bar - - @snack_bar.setter - @deprecated( - reason="Use Page.overlay.append(snack_bar) instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def snack_bar(self, value: Optional[SnackBar]): - self.__offstage.snack_bar = value - - # dialog - @property - def dialog(self) -> Optional[Control]: - return self.__offstage.dialog - - @dialog.setter - @deprecated( - reason="Use Page.overlay.append(dialog) instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def dialog(self, value: Optional[Control]): - self.__offstage.dialog = value - - # bottom_sheet - @property - def bottom_sheet(self) -> Optional[BottomSheet]: - return self.__offstage.bottom_sheet - - @bottom_sheet.setter - @deprecated( - reason="Use Page.overlay.append(bottom_sheet) instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def bottom_sheet(self, value: Optional[BottomSheet]): - self.__offstage.bottom_sheet = value - # theme_mode @property def theme_mode(self) -> Optional[ThemeMode]: @@ -2189,573 +1705,6 @@ def height(self) -> OptionalNumber: h = self._get_attr("height") return float(h) if h else 0 - # window_bgcolor - @property - @deprecated( - reason="Use Page.window.bgcolor instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_bgcolor(self) -> Optional[ColorValue]: - return self.__window.bgcolor - - @window_bgcolor.setter - @deprecated( - reason="Use Page.window.bgcolor instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_bgcolor(self, value: Optional[ColorValue]): - self.__window.bgcolor = value - - # window_width - @property - @deprecated( - reason="Use Page.window.width instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_width(self) -> OptionalNumber: - return self.__window.width - - @window_width.setter - @deprecated( - reason="Use Page.window.width instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_width(self, value: OptionalNumber): - self.__window.width = value - - # window_height - @property - @deprecated( - reason="Use Page.window.height instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_height(self) -> OptionalNumber: - return self.__window.height - - @window_height.setter - @deprecated( - reason="Use Page.window.height instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_height(self, value: OptionalNumber): - self.__window.height = value - - # window_top - @property - @deprecated( - reason="Use Page.window.top instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_top(self) -> OptionalNumber: - return self.__window.top - - @window_top.setter - @deprecated( - reason="Use Page.window.top instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_top(self, value: OptionalNumber): - self.__window.top = value - - # window_left - @property - @deprecated( - reason="Use Page.window.left instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_left(self) -> OptionalNumber: - return self.__window.left - - @window_left.setter - @deprecated( - reason="Use Page.window.left instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_left(self, value: OptionalNumber): - self.__window.left = value - - # window_max_width - @property - @deprecated( - reason="Use Page.window.max_width instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_max_width(self) -> OptionalNumber: - return self.__window.max_width - - @window_max_width.setter - @deprecated( - reason="Use Page.window.max_width instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_max_width(self, value: OptionalNumber): - self.__window.max_width = value - - # window_max_height - @property - @deprecated( - reason="Use Page.window.max_height instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_max_height(self) -> OptionalNumber: - return self.__window.max_height - - @window_max_height.setter - @deprecated( - reason="Use Page.window.max_height instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_max_height(self, value: OptionalNumber): - self.__window.max_height = value - - # window_min_width - @property - @deprecated( - reason="Use Page.window.min_width instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_min_width(self) -> OptionalNumber: - return self.__window.min_width - - @window_min_width.setter - @deprecated( - reason="Use Page.window.min_width instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_min_width(self, value: OptionalNumber): - self.__window.min_width = value - - # window_min_height - @property - @deprecated( - reason="Use Page.window.min_height instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_min_height(self) -> OptionalNumber: - return self.__window.min_height - - @window_min_height.setter - @deprecated( - reason="Use Page.window.min_height instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_min_height(self, value: OptionalNumber): - self.__window.min_height = value - - # window_opacity - @property - @deprecated( - reason="Use Page.window.opacity instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_opacity(self) -> OptionalNumber: - return self.__window.opacity - - @window_opacity.setter - @deprecated( - reason="Use Page.window.opacity instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_opacity(self, value: OptionalNumber): - self.__window.opacity = value - - # window_maximized - @property - @deprecated( - reason="Use Page.window.maximized instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_maximized(self) -> Optional[bool]: - return self.__window.maximized - - @window_maximized.setter - @deprecated( - reason="Use Page.window.maximized instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_maximized(self, value: Optional[bool]): - self.__window.maximized = value - - # window_minimized - @property - @deprecated( - reason="Use Page.window.minimized instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_minimized(self) -> Optional[bool]: - return self.__window.minimized - - @window_minimized.setter - @deprecated( - reason="Use Page.window.minimized instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_minimized(self, value: Optional[bool]): - self.__window.minimized = value - - # window_minimizable - @property - @deprecated( - reason="Use Page.window.minimizable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_minimizable(self) -> Optional[bool]: - return self.__window.minimizable - - @window_minimizable.setter - @deprecated( - reason="Use Page.window.minimizable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_minimizable(self, value: Optional[bool]): - self.__window.minimizable = value - - # window_maximizable - @property - @deprecated( - reason="Use Page.window.maximizable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_maximizable(self) -> Optional[bool]: - return self.__window.maximizable - - @window_maximizable.setter - @deprecated( - reason="Use Page.window.maximizable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_maximizable(self, value: Optional[bool]): - self.__window.maximizable = value - - # window_resizable - @property - @deprecated( - reason="Use Page.window.resizable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_resizable(self) -> Optional[bool]: - return self.__window.resizable - - @window_resizable.setter - @deprecated( - reason="Use Page.window.resizable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_resizable(self, value: Optional[bool]): - self.__window.resizable = value - - # window_movable - @property - @deprecated( - reason="Use Page.window.movable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_movable(self) -> Optional[bool]: - return self.__window.movable - - @window_movable.setter - @deprecated( - reason="Use Page.window.movable instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_movable(self, value: Optional[bool]): - self.__window.movable = value - - # window_full_screen - @property - @deprecated( - reason="Use Page.window.full_screen instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_full_screen(self) -> Optional[bool]: - return self.__window.full_screen - - @window_full_screen.setter - @deprecated( - reason="Use Page.window.full_screen instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_full_screen(self, value: Optional[bool]): - self.__window.full_screen = value - - # window_always_on_top - @property - @deprecated( - reason="Use Page.window.always_on_top instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_always_on_top(self) -> Optional[bool]: - return self.__window.always_on_top - - @window_always_on_top.setter - @deprecated( - reason="Use Page.window.always_on_top instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_always_on_top(self, value: Optional[bool]): - self.__window.always_on_top = value - - # window_always_on_bottom - @property - @deprecated( - reason="Use Page.window.always_on_bottom instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_always_on_bottom(self) -> Optional[bool]: - return self.__window.always_on_bottom - - @window_always_on_bottom.setter - @deprecated( - reason="Use Page.window.always_on_bottom instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_always_on_bottom(self, value: Optional[bool]): - self.window_always_on_bottom = value - - # window_prevent_close - @property - @deprecated( - reason="Use Page.window.prevent_close instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_prevent_close(self) -> Optional[bool]: - return self.__window.prevent_close - - @window_prevent_close.setter - @deprecated( - reason="Use Page.window.prevent_close instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_prevent_close(self, value: Optional[bool]): - self.__window.prevent_close = value - - # window_title_bar_hidden - @property - @deprecated( - reason="Use Page.window.title_bar_hidden instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_title_bar_hidden(self) -> Optional[bool]: - return self.__window.title_bar_hidden - - @window_title_bar_hidden.setter - @deprecated( - reason="Use Page.window.title_bar_hidden instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_title_bar_hidden(self, value: Optional[bool]): - self.__window.title_bar_hidden = value - - # window_title_bar_buttons_hidden - @property - @deprecated( - reason="Use Page.window.title_bar_buttons_hidden instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_title_bar_buttons_hidden(self) -> Optional[bool]: - return self.__window.title_bar_buttons_hidden - - @window_title_bar_buttons_hidden.setter - @deprecated( - reason="Use Page.window.title_bar_buttons_hidden instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_title_bar_buttons_hidden(self, value: Optional[bool]): - self.__window.title_bar_buttons_hidden = value - - # window_skip_task_bar - @property - @deprecated( - reason="Use Page.window.skip_task_bar instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_skip_task_bar(self) -> Optional[bool]: - return self.__window.skip_task_bar - - @window_skip_task_bar.setter - @deprecated( - reason="Use Page.window.skip_task_bar instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_skip_task_bar(self, value: Optional[bool]): - self.__window.skip_taskbar = value - - # window_frameless - @property - @deprecated( - reason="Use Page.window.frameless instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_frameless(self) -> Optional[bool]: - return self.__window.frameless - - @window_frameless.setter - @deprecated( - reason="Use Page.window.frameless instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_frameless(self, value: Optional[bool]): - self.__window.frameless = value - - # window_progress_bar - @property - @deprecated( - reason="Use Page.window.progress_bar instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_progress_bar(self) -> OptionalNumber: - return self.__window.progress_bar - - @window_progress_bar.setter - @deprecated( - reason="Use Page.window.progress_bar instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_progress_bar(self, value: OptionalNumber): - self.__window.progress_bar = value - - # window_focused - @property - @deprecated( - reason="Use Page.window.focused instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_focused(self) -> Optional[bool]: - return self.__window.focused - - @window_focused.setter - @deprecated( - reason="Use Page.window.focused instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_focused(self, value: Optional[bool]): - self.__window.focused = value - - # window_visible - @property - @deprecated( - reason="Use Page.window.visible instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_visible(self) -> Optional[bool]: - return self.__window.visible - - @window_visible.setter - @deprecated( - reason="Use Page.window.visible instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def window_visible(self, value: Optional[bool]): - self.__window.visible = value - # on_scroll_interval @property def on_scroll_interval(self) -> OptionalNumber: @@ -2774,27 +1723,6 @@ def on_close(self) -> OptionalControlEventCallable: def on_close(self, handler: OptionalControlEventCallable): self.__on_close.handler = handler - # on_resize - @property - @deprecated( - reason="Use Page.on_resized instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def on_resize(self) -> OptionalEventCallable["WindowResizeEvent"]: - return self.__on_resized.handler - - @on_resize.setter - @deprecated( - reason="Use on_resized instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def on_resize(self, handler: OptionalEventCallable["WindowResizeEvent"]): - self.__on_resized.handler = handler - @property def on_resized(self) -> OptionalEventCallable["WindowResizeEvent"]: return self.__on_resized.handler @@ -2853,27 +1781,6 @@ def on_keyboard_event(self, handler: OptionalEventCallable["KeyboardEvent"]): self.__on_keyboard_event.handler = handler self._set_attr("onKeyboardEvent", True if handler else None) - # on_window_event - @property - @deprecated( - reason="Use Page.on_window_event instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def on_window_event(self) -> OptionalEventCallable["WindowEvent"]: - return self.__window.on_event.handler - - @on_window_event.setter - @deprecated( - "Use Page.window.on_event instead.", - version="0.23.0", - delete_version="0.26.0", - is_method=False, - ) - def on_window_event(self, handler: OptionalEventCallable["WindowEvent"]): - self.__window.on_event.handler = handler - # on_media_change @property def on_media_change(self) -> OptionalEventCallable["PageMediaData"]: diff --git a/sdk/python/packages/flet/src/flet/core/pagelet.py b/sdk/python/packages/flet/src/flet/core/pagelet.py index aefbca236..09e36b0be 100644 --- a/sdk/python/packages/flet/src/flet/core/pagelet.py +++ b/sdk/python/packages/flet/src/flet/core/pagelet.py @@ -192,27 +192,11 @@ def show_drawer(self, drawer: NavigationDrawer): self.drawer.open = True self.update() - @deprecated( - reason="Use show_drawer() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_drawer_async(self, drawer: NavigationDrawer): - self.show_drawer(drawer) - def close_drawer(self): if self.drawer is not None: self.drawer.open = False self.update() - @deprecated( - reason="Use close_end_drawer() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_drawer_async(self): - self.close_end_drawer() - # End_drawer # def show_end_drawer(self, end_drawer: NavigationDrawer): @@ -220,27 +204,11 @@ def show_end_drawer(self, end_drawer: NavigationDrawer): self.end_drawer.open = True self.update() - @deprecated( - reason="Use show_end_drawer() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def show_end_drawer_async(self, end_drawer: NavigationDrawer): - self.show_end_drawer(end_drawer) - def close_end_drawer(self): if self.end_drawer is not None: self.end_drawer.open = False self.update() - @deprecated( - reason="Use close_end_drawer() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_end_drawer_async(self): - self.close_end_drawer() - # appbar @property def appbar(self) -> Union[AppBar, CupertinoAppBar, None]: diff --git a/sdk/python/packages/flet/src/flet/core/popup_menu_button.py b/sdk/python/packages/flet/src/flet/core/popup_menu_button.py index 811101672..ab3fc33b1 100644 --- a/sdk/python/packages/flet/src/flet/core/popup_menu_button.py +++ b/sdk/python/packages/flet/src/flet/core/popup_menu_button.py @@ -516,28 +516,6 @@ def on_cancel(self) -> OptionalControlEventCallable: def on_cancel(self, handler: OptionalControlEventCallable): self._add_event_handler("cancel", handler) - # on_cancelled - @property - def on_cancelled(self) -> OptionalControlEventCallable: - warnings.warn( - f"on_cancelled is deprecated/renamed since version 0.22.0 " - f"and will be removed in version 0.26.0. Use on_cancel instead.", - category=DeprecationWarning, - stacklevel=2, - ) - return self._get_event_handler("cancelled") - - @on_cancelled.setter - def on_cancelled(self, handler: OptionalControlEventCallable): - self._add_event_handler("cancelled", handler) - if handler is not None: - warnings.warn( - f"on_cancelled is deprecated/renamed since version 0.22.0 " - f"and will be removed in version 0.26.0. Use on_cancel instead.", - category=DeprecationWarning, - stacklevel=2, - ) - # on_open @property def on_open(self) -> OptionalControlEventCallable: diff --git a/sdk/python/packages/flet/src/flet/core/pubsub/pubsub_client.py b/sdk/python/packages/flet/src/flet/core/pubsub/pubsub_client.py index a8d8d02fd..068802244 100644 --- a/sdk/python/packages/flet/src/flet/core/pubsub/pubsub_client.py +++ b/sdk/python/packages/flet/src/flet/core/pubsub/pubsub_client.py @@ -16,98 +16,26 @@ def __init__(self, pubsub: PubSubHub, session_id: str): def send_all(self, message: Any): self.__pubsub.send_all(message) - @deprecated( - reason="Use send_all() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def send_all_async(self, message: Any): - self.send_all(message) - def send_all_on_topic(self, topic: str, message: Any): self.__pubsub.send_all_on_topic(topic, message) - @deprecated( - reason="Use send_all_on_topic() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def send_all_on_topic_async(self, topic: str, message: Any): - self.send_all_on_topic(topic, message) - def send_others(self, message: Any): self.__pubsub.send_others(self.__session_id, message) - @deprecated( - reason="Use send_others() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def send_others_async(self, message: Any): - self.send_others(message) - def send_others_on_topic(self, topic: str, message: Any): self.__pubsub.send_others_on_topic(self.__session_id, topic, message) - @deprecated( - reason="Use send_others_on_topic() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def send_others_on_topic_async(self, topic: str, message: Any): - self.send_others_on_topic(topic, message) - def subscribe(self, handler: Callable): self.__pubsub.subscribe(self.__session_id, handler) - @deprecated( - reason="Use subscribe() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def subscribe_async(self, handler: Callable): - self.subscribe(handler) - def subscribe_topic(self, topic: str, handler: Callable): self.__pubsub.subscribe_topic(self.__session_id, topic, handler) - @deprecated( - reason="Use subscribe_topic() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def subscribe_topic_async(self, topic: str, handler: Callable): - self.subscribe_topic(topic, handler) - def unsubscribe(self): self.__pubsub.unsubscribe(self.__session_id) - @deprecated( - reason="Use unsubscribe() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def unsubscribe_async(self): - self.unsubscribe() - def unsubscribe_topic(self, topic: str): self.__pubsub.unsubscribe_topic(self.__session_id, topic) - @deprecated( - reason="Use unsubscribe_topic() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def unsubscribe_topic_async(self, topic: str): - self.unsubscribe_topic(topic) - def unsubscribe_all(self): self.__pubsub.unsubscribe_all(self.__session_id) - - @deprecated( - reason="Use unsubscribe_all() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def unsubscribe_all_async(self): - self.unsubscribe_all() diff --git a/sdk/python/packages/flet/src/flet/core/responsive_row.py b/sdk/python/packages/flet/src/flet/core/responsive_row.py index 08637c64e..7571b18e0 100644 --- a/sdk/python/packages/flet/src/flet/core/responsive_row.py +++ b/sdk/python/packages/flet/src/flet/core/responsive_row.py @@ -148,14 +148,6 @@ def clean(self): super().clean() self.__controls.clear() - @deprecated( - reason="Use clean() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def clean_async(self): - self.clean() - # horizontal_alignment @property def alignment(self) -> Optional[MainAxisAlignment]: diff --git a/sdk/python/packages/flet/src/flet/core/row.py b/sdk/python/packages/flet/src/flet/core/row.py index 31b701247..158a7e52d 100644 --- a/sdk/python/packages/flet/src/flet/core/row.py +++ b/sdk/python/packages/flet/src/flet/core/row.py @@ -174,14 +174,6 @@ def clean(self): super().clean() self.__controls.clear() - @deprecated( - reason="Use clean() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def clean_async(self): - self.clean() - # tight @property def tight(self) -> bool: diff --git a/sdk/python/packages/flet/src/flet/core/safe_area.py b/sdk/python/packages/flet/src/flet/core/safe_area.py index ab2df7610..6e1858fc1 100644 --- a/sdk/python/packages/flet/src/flet/core/safe_area.py +++ b/sdk/python/packages/flet/src/flet/core/safe_area.py @@ -171,28 +171,6 @@ def content(self) -> Control: def content(self, value: Control): self.__content = value - # minimum - @property - def minimum(self) -> PaddingValue: - warnings.warn( - f"minimum is deprecated since version 0.23.0 " - f"and will be removed in version 0.26.0. Use minimum_padding instead.", - category=DeprecationWarning, - stacklevel=2, - ) - return self.__minimum - - @minimum.setter - def minimum(self, value: PaddingValue): - self.__minimum = value - if value is not None: - warnings.warn( - f"minimum is deprecated since version 0.23.0 " - f"and will be removed in version 0.26.0. Use minimum_padding instead.", - category=DeprecationWarning, - stacklevel=2, - ) - # minimum_padding @property def minimum_padding(self) -> PaddingValue: diff --git a/sdk/python/packages/flet/src/flet/core/scrollable_control.py b/sdk/python/packages/flet/src/flet/core/scrollable_control.py index bf3db7d8c..d1d71e047 100644 --- a/sdk/python/packages/flet/src/flet/core/scrollable_control.py +++ b/sdk/python/packages/flet/src/flet/core/scrollable_control.py @@ -51,21 +51,6 @@ def scroll_to( self._set_attr_json("method", m) self.update() - @deprecated( - reason="Use scroll_to() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def scroll_to_async( - self, - offset: Optional[float] = None, - delta: Optional[float] = None, - key: Optional[str] = None, - duration: Optional[int] = None, - curve: Optional[AnimationCurve] = None, - ): - self.scroll_to(offset, delta, key, duration, curve) - # scroll @property def scroll(self) -> Optional[ScrollMode]: diff --git a/sdk/python/packages/flet/src/flet/core/search_bar.py b/sdk/python/packages/flet/src/flet/core/search_bar.py index 2c419111a..9f9732204 100644 --- a/sdk/python/packages/flet/src/flet/core/search_bar.py +++ b/sdk/python/packages/flet/src/flet/core/search_bar.py @@ -240,14 +240,6 @@ def open_view(self): self._set_attr_json("method", m) self.update() - @deprecated( - reason="Use open_view() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def open_view_async(self): - self.open_view() - def close_view(self, text: str = ""): m = { "n": "closeView", @@ -258,14 +250,6 @@ def close_view(self, text: str = ""): self._set_attr_json("method", m) self.update() - @deprecated( - reason="Use close_view() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def close_view_async(self, text: str = ""): - self.close_view(text=text) - # bar_leading @property def bar_leading(self) -> Optional[Control]: diff --git a/sdk/python/packages/flet/src/flet/core/submenu_button.py b/sdk/python/packages/flet/src/flet/core/submenu_button.py index 384ab9f59..7c536fee1 100644 --- a/sdk/python/packages/flet/src/flet/core/submenu_button.py +++ b/sdk/python/packages/flet/src/flet/core/submenu_button.py @@ -160,14 +160,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # controls @property def controls(self): diff --git a/sdk/python/packages/flet/src/flet/core/text_button.py b/sdk/python/packages/flet/src/flet/core/text_button.py index 280b7f497..566b0ade4 100644 --- a/sdk/python/packages/flet/src/flet/core/text_button.py +++ b/sdk/python/packages/flet/src/flet/core/text_button.py @@ -163,14 +163,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # text @property def text(self) -> Optional[str]: diff --git a/sdk/python/packages/flet/src/flet/core/textfield.py b/sdk/python/packages/flet/src/flet/core/textfield.py index bab879a54..01e6eb5f4 100644 --- a/sdk/python/packages/flet/src/flet/core/textfield.py +++ b/sdk/python/packages/flet/src/flet/core/textfield.py @@ -399,14 +399,6 @@ def focus(self): self._set_attr_json("focus", str(time.time())) self.update() - @deprecated( - reason="Use focus() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def focus_async(self): - self.focus() - # value @property def value(self) -> Optional[str]: diff --git a/sdk/python/packages/flet/src/flet/core/time_picker.py b/sdk/python/packages/flet/src/flet/core/time_picker.py index bc4ac8f95..8c7a401f9 100644 --- a/sdk/python/packages/flet/src/flet/core/time_picker.py +++ b/sdk/python/packages/flet/src/flet/core/time_picker.py @@ -152,23 +152,6 @@ def __init__( def _get_control_name(self): return "timepicker" - @deprecated( - reason="Use Page.open() method instead.", - version="0.23.0", - delete_version="0.26.0", - ) - def pick_time(self): - self.open = True - self.update() - - @deprecated( - reason="Use Page.open() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def pick_time_async(self): - self.pick_time() - # open @property def open(self) -> bool: diff --git a/sdk/python/packages/flet/src/flet/core/types.py b/sdk/python/packages/flet/src/flet/core/types.py index 791351a24..814476c29 100644 --- a/sdk/python/packages/flet/src/flet/core/types.py +++ b/sdk/python/packages/flet/src/flet/core/types.py @@ -127,40 +127,6 @@ class NotchShape(Enum): OptionalString = Optional[str] -class MaterialStateDeprecated(EnumMeta): - def __getattribute__(self, item): - if item in [ - "HOVERED", - "FOCUSED", - "PRESSED", - "DRAGGED", - "SELECTED", - "SCROLLED_UNDER", - "DISABLED", - "ERROR", - "DEFAULT", - ]: - warn( - "MaterialState enum is deprecated and will be removed in version 0.26.0. " - "Use ControlState enum instead.", - DeprecationWarning, - stacklevel=2, - ) - return EnumMeta.__getattribute__(self, item) - - -class MaterialState(Enum, metaclass=MaterialStateDeprecated): - HOVERED = "hovered" - FOCUSED = "focused" - PRESSED = "pressed" - DRAGGED = "dragged" - SELECTED = "selected" - SCROLLED_UNDER = "scrolledUnder" - DISABLED = "disabled" - ERROR = "error" - DEFAULT = "" - - class ControlState(Enum): HOVERED = "hovered" FOCUSED = "focused" diff --git a/sdk/python/packages/flet/src/flet/core/user_control.py b/sdk/python/packages/flet/src/flet/core/user_control.py deleted file mode 100644 index e52de103b..000000000 --- a/sdk/python/packages/flet/src/flet/core/user_control.py +++ /dev/null @@ -1,15 +0,0 @@ -from flet.core.stack import Stack -from flet.utils.deprecated import deprecated_class - - -@deprecated_class( - reason="UserControl is deprecated. See https://flet.dev/docs/getting-started/custom-controls.", - version="0.21.0", - delete_version="0.26.0", -) -class UserControl(Stack): - def build(self): - pass - - def is_isolated(self): - return True diff --git a/sdk/python/packages/flet/src/flet/core/video.py b/sdk/python/packages/flet/src/flet/core/video.py index 66e3cf126..5f93717df 100644 --- a/sdk/python/packages/flet/src/flet/core/video.py +++ b/sdk/python/packages/flet/src/flet/core/video.py @@ -199,80 +199,24 @@ def before_update(self): def play(self): self.invoke_method("play") - @deprecated( - reason="Use play() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def play_async(self): - self.play() - def pause(self): self.invoke_method("pause") - @deprecated( - reason="Use pause() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def pause_async(self): - self.pause() - def play_or_pause(self): self.invoke_method("play_or_pause") - @deprecated( - reason="Use play_or_pause() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def play_or_pause_async(self): - self.play_or_pause() - def stop(self): self.invoke_method("stop") - @deprecated( - reason="Use stop() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def stop_async(self): - self.stop() - def next(self): self.invoke_method("next") - @deprecated( - reason="Use next() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def next_async(self): - self.next() - def previous(self): self.invoke_method("previous") - @deprecated( - reason="Use previous() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def previous_async(self): - self.previous() - def seek(self, position_milliseconds: int): self.invoke_method("seek", {"position": str(position_milliseconds)}) - @deprecated( - reason="Use seek() method instead.", - version="0.25.0", - delete_version="0.28.0", - ) - async def seek_async(self, position_milliseconds: int): - await self.invoke_method_async("seek", {"position": str(position_milliseconds)}) - def jump_to(self, media_index: int): assert self.__playlist[media_index], "media_index is out of range" if media_index < 0: @@ -280,18 +224,6 @@ def jump_to(self, media_index: int): media_index = len(self.__playlist) + media_index self.invoke_method("jump_to", {"media_index": str(media_index)}) - @deprecated( - reason="Use jump_to() method instead.", - version="0.25.0", - delete_version="0.28.0", - ) - async def jump_to_async(self, media_index: int): - assert self.__playlist[media_index], "media_index is out of range" - if media_index < 0: - # dart doesn't support negative indexes - media_index = len(self.__playlist) + media_index - await self.invoke_method_async("jump_to", {"media_index": str(media_index)}) - def playlist_add(self, media: VideoMedia): assert media.resource, "media has no resource" self.invoke_method( @@ -304,27 +236,11 @@ def playlist_add(self, media: VideoMedia): ) self.__playlist.append(media) - @deprecated( - reason="Use playlist_add() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def playlist_add_async(self, media: VideoMedia): - self.playlist_add(media) - def playlist_remove(self, media_index: int): assert self.__playlist[media_index], "index out of range" self.invoke_method("playlist_remove", {"media_index": str(media_index)}) self.__playlist.pop(media_index) - @deprecated( - reason="Use playlist_remove() method instead.", - version="0.21.0", - delete_version="0.26.0", - ) - async def playlist_remove_async(self, media_index: int): - self.playlist_remove(media_index) - def is_playing(self, wait_timeout: Optional[float] = 5) -> bool: playing = self.invoke_method( "is_playing", From 4ab1b1321157c52722bc9d30b20bde6d4a5d379d Mon Sep 17 00:00:00 2001 From: TheEthicalBoy <98978078+ndonkoHenri@users.noreply.github.com> Date: Thu, 5 Dec 2024 21:04:00 +0100 Subject: [PATCH 4/5] fix: `SafeArea` object has no attribute `_SafeArea__minimum` (#4500) * remove minimum from SafeArea * remove deprecated props --- sdk/python/packages/flet/src/flet/core/circle_avatar.py | 4 ---- sdk/python/packages/flet/src/flet/core/popup_menu_button.py | 1 - sdk/python/packages/flet/src/flet/core/safe_area.py | 3 --- 3 files changed, 8 deletions(-) diff --git a/sdk/python/packages/flet/src/flet/core/circle_avatar.py b/sdk/python/packages/flet/src/flet/core/circle_avatar.py index 1cb6e86d4..9a242b617 100644 --- a/sdk/python/packages/flet/src/flet/core/circle_avatar.py +++ b/sdk/python/packages/flet/src/flet/core/circle_avatar.py @@ -78,8 +78,6 @@ def main(page): def __init__( self, content: Optional[Control] = None, - foreground_image_url: Optional[str] = None, - background_image_url: Optional[str] = None, foreground_image_src: Optional[str] = None, background_image_src: Optional[str] = None, color: Optional[ColorValue] = None, @@ -152,8 +150,6 @@ def __init__( data=data, ) - self.foreground_image_url = foreground_image_url - self.background_image_url = background_image_url self.foreground_image_src = foreground_image_src self.background_image_src = background_image_src self.radius = radius diff --git a/sdk/python/packages/flet/src/flet/core/popup_menu_button.py b/sdk/python/packages/flet/src/flet/core/popup_menu_button.py index ab3fc33b1..57a2e157e 100644 --- a/sdk/python/packages/flet/src/flet/core/popup_menu_button.py +++ b/sdk/python/packages/flet/src/flet/core/popup_menu_button.py @@ -217,7 +217,6 @@ def __init__( style: Optional[ButtonStyle] = None, popup_animation_style: Optional[AnimationStyle] = None, size_constraints: Optional[BoxConstraints] = None, - on_cancelled: OptionalControlEventCallable = None, on_open: OptionalControlEventCallable = None, on_cancel: OptionalControlEventCallable = None, on_select: OptionalControlEventCallable = None, diff --git a/sdk/python/packages/flet/src/flet/core/safe_area.py b/sdk/python/packages/flet/src/flet/core/safe_area.py index 6e1858fc1..78b425a66 100644 --- a/sdk/python/packages/flet/src/flet/core/safe_area.py +++ b/sdk/python/packages/flet/src/flet/core/safe_area.py @@ -27,7 +27,6 @@ def __init__( right: Optional[bool] = None, bottom: Optional[bool] = None, maintain_bottom_view_padding: Optional[bool] = None, - minimum: PaddingValue = None, minimum_padding: PaddingValue = None, # # ConstrainedControl @@ -99,7 +98,6 @@ def __init__( self.right = right self.bottom = bottom self.maintain_bottom_view_padding = maintain_bottom_view_padding - self.minimum = minimum self.minimum_padding = minimum_padding def _get_control_name(self): @@ -108,7 +106,6 @@ def _get_control_name(self): def before_update(self): super().before_update() assert self.__content.visible, "content must be visible" - self._set_attr_json("minimum", self.__minimum) self._set_attr_json("minimumPadding", self.__minimum_padding) def _get_children(self): From bdc82dd365750eb59cd4b0ca43987d478ecb54e7 Mon Sep 17 00:00:00 2001 From: Feodor Fitsner Date: Fri, 6 Dec 2024 10:29:41 -0800 Subject: [PATCH 5/5] Add `flet` if no dependencies provided for `flet publish` command Fix #4493 --- sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py | 4 ++++ sdk/python/packages/flet/src/flet/cli.py | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py b/sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py index 6a575e81f..1f8d95f17 100644 --- a/sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py +++ b/sdk/python/packages/flet-cli/src/flet_cli/commands/publish.py @@ -113,6 +113,7 @@ def add_arguments(self, parser: argparse.ArgumentParser) -> None: ) def handle(self, options: argparse.Namespace) -> None: + import flet.version from flet.utils.pip import ensure_flet_web_package_installed ensure_flet_web_package_installed() @@ -197,6 +198,9 @@ def handle(self, options: argparse.Namespace) -> None: ) print(f"{reqs_filename} dependencies: {deps}") + if len(deps) == 0: + deps = [f"flet=={flet.version.version}"] + temp_reqs_txt = Path(tempfile.gettempdir()).joinpath(random_string(10)) with open(temp_reqs_txt, "w") as f: f.writelines(dep + "\n" for dep in deps) diff --git a/sdk/python/packages/flet/src/flet/cli.py b/sdk/python/packages/flet/src/flet/cli.py index 8e9ec2c1c..2bc8eac4e 100644 --- a/sdk/python/packages/flet/src/flet/cli.py +++ b/sdk/python/packages/flet/src/flet/cli.py @@ -1,7 +1,6 @@ import subprocess import sys -import flet.version from flet.utils.pip import ensure_flet_cli_package_installed