diff --git a/sdk/python/packages/flet-ads/README.md b/sdk/python/packages/flet-ads/README.md index d6628e2491..239e67eca3 100644 --- a/sdk/python/packages/flet-ads/README.md +++ b/sdk/python/packages/flet-ads/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-ads.svg)](https://pypi.python.org/pypi/flet-ads) [![downloads](https://static.pepy.tech/badge/flet-ads/month)](https://pepy.tech/project/flet-ads) -[![license](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-ads.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-ads/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-ads/LICENSE) Display Google Ads in [Flet](https://flet.dev) apps. diff --git a/sdk/python/packages/flet-audio-recorder/README.md b/sdk/python/packages/flet-audio-recorder/README.md index 87eee3e93a..bdade8c29f 100644 --- a/sdk/python/packages/flet-audio-recorder/README.md +++ b/sdk/python/packages/flet-audio-recorder/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-audio-recorder.svg)](https://pypi.python.org/pypi/flet-audio-recorder) [![downloads](https://static.pepy.tech/badge/flet-audio-recorder/month)](https://pepy.tech/project/flet-audio-recorder) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio-recorder/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio-recorder/LICENSE) Adds audio recording support to [Flet](https://flet.dev) apps. diff --git a/sdk/python/packages/flet-audio/README.md b/sdk/python/packages/flet-audio/README.md index d2c818eae2..04468e92b0 100644 --- a/sdk/python/packages/flet-audio/README.md +++ b/sdk/python/packages/flet-audio/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-audio.svg)](https://pypi.python.org/pypi/flet-audio) [![downloads](https://static.pepy.tech/badge/flet-audio/month)](https://pepy.tech/project/flet-audio) -[![license](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-audio/LICENSE) A [Flet](https://flet.dev) extension package for playing audio. @@ -35,6 +35,17 @@ To install the `flet-audio` package and add it to your project dependencies: ``` After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`. +> [!NOTE] +> On Linux/WSL, you need to install [`GStreamer`](https://github.com/GStreamer/gstreamer) library. +> +> If you receive `error while loading shared libraries: libgstapp-1.0.so.0`, it means `GStreamer` is not installed in your WSL environment. +> +> To install it, run the following command: +> +> ```bash +> apt install -y libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools +> ``` + ### Examples For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/audio). diff --git a/sdk/python/packages/flet-charts/README.md b/sdk/python/packages/flet-charts/README.md index 14e9ec60a6..96709b91eb 100644 --- a/sdk/python/packages/flet-charts/README.md +++ b/sdk/python/packages/flet-charts/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-charts.svg)](https://pypi.python.org/pypi/flet-charts) [![downloads](https://static.pepy.tech/badge/flet-charts/month)](https://pepy.tech/project/flet-charts) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-charts/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-charts/LICENSE) A [Flet](https://flet.dev) extension for creating interactive charts and graphs. diff --git a/sdk/python/packages/flet-datatable2/README.md b/sdk/python/packages/flet-datatable2/README.md index a1c2fbf7a7..bb46e5ffdf 100644 --- a/sdk/python/packages/flet-datatable2/README.md +++ b/sdk/python/packages/flet-datatable2/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-datatable2.svg)](https://pypi.python.org/pypi/flet-datatable2) [![downloads](https://static.pepy.tech/badge/flet-datatable2/month)](https://pepy.tech/project/flet-datatable2) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-datatable2/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-datatable2/LICENSE) An enhanced data table for [Flet](https://flet.dev) apps that builds on the built-in component by adding sticky headers, fixed top rows, and fixed left columns while preserving all core features. @@ -17,14 +17,9 @@ You can find its documentation [here](https://docs.flet.dev/datatable2/). This package supports the following platforms: -| Platform | Supported | -|----------|:---------:| -| Windows | ✅ | -| macOS | ✅ | -| Linux | ✅ | -| iOS | ✅ | -| Android | ✅ | -| Web | ✅ | +| Platform | Windows | macOS | Linux | iOS | Android | Web | +|----------|---------|-------|-------|-----|---------|-----| +| Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ## Usage @@ -43,11 +38,6 @@ To install the `flet-datatable2` package and add it to your project dependencies ``` After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`. -- Using `poetry`: - ```bash - poetry add flet-datatable2 - ``` - ### Examples For examples, see [these](https://github.com/flet-dev/flet/tree/main/examples/controls/datatable2). diff --git a/sdk/python/packages/flet-flashlight/README.md b/sdk/python/packages/flet-flashlight/README.md index 1d7df6249b..7cf567f7e2 100644 --- a/sdk/python/packages/flet-flashlight/README.md +++ b/sdk/python/packages/flet-flashlight/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-flashlight.svg)](https://pypi.python.org/pypi/flet-flashlight) [![downloads](https://static.pepy.tech/badge/flet-flashlight/month)](https://pepy.tech/project/flet-flashlight) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-flashlight/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-flashlight/LICENSE) A [Flet](https://flet.dev) extension to manage the device torch/flashlight. diff --git a/sdk/python/packages/flet-geolocator/README.md b/sdk/python/packages/flet-geolocator/README.md index 16dcc448e2..37c2bf6aa7 100644 --- a/sdk/python/packages/flet-geolocator/README.md +++ b/sdk/python/packages/flet-geolocator/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-geolocator.svg)](https://pypi.python.org/pypi/flet-geolocator) [![downloads](https://static.pepy.tech/badge/flet-geolocator/month)](https://pepy.tech/project/flet-geolocator) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-geolocator/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-geolocator/LICENSE) Adds geolocation capabilities to your [Flet](https://flet.dev) apps. @@ -14,8 +14,6 @@ Features include: It is based on the [geolocator](https://pub.dev/packages/geolocator) Flutter package. -> **Important:** Add the `Geolocator` instance to `page.services` before invoking its methods. - ## Documentation Detailed documentation to this package can be found [here](https://docs.flet.dev/geolocator/). diff --git a/sdk/python/packages/flet-lottie/README.md b/sdk/python/packages/flet-lottie/README.md index 54a5580c1b..22ba7eb546 100644 --- a/sdk/python/packages/flet-lottie/README.md +++ b/sdk/python/packages/flet-lottie/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-lottie.svg)](https://pypi.python.org/pypi/flet-lottie) [![downloads](https://static.pepy.tech/badge/flet-lottie/month)](https://pepy.tech/project/flet-lottie) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-lottie/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-lottie/LICENSE) A [Flet](https://flet.dev) extension package for displaying Lottie animations. diff --git a/sdk/python/packages/flet-map/README.md b/sdk/python/packages/flet-map/README.md index f839a6bc47..644f33f77e 100644 --- a/sdk/python/packages/flet-map/README.md +++ b/sdk/python/packages/flet-map/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-map.svg)](https://pypi.python.org/pypi/flet-map) [![downloads](https://static.pepy.tech/badge/flet-map/month)](https://pepy.tech/project/flet-map) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-map/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-map/LICENSE) A [Flet](https://flet.dev) extension for displaying interactive maps. diff --git a/sdk/python/packages/flet-permission-handler/README.md b/sdk/python/packages/flet-permission-handler/README.md index 5d2b220ed5..d8a4dc0875 100644 --- a/sdk/python/packages/flet-permission-handler/README.md +++ b/sdk/python/packages/flet-permission-handler/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-permission-handler.svg)](https://pypi.python.org/pypi/flet-permission-handler) [![downloads](https://static.pepy.tech/badge/flet-permission-handler/month)](https://pepy.tech/project/flet-permission-handler) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-permission-handler/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-permission-handler/LICENSE) A [Flet](https://flet.dev) extension that simplifies working with device permissions. diff --git a/sdk/python/packages/flet-rive/README.md b/sdk/python/packages/flet-rive/README.md index 3ba3e37b6a..798ccf68d0 100644 --- a/sdk/python/packages/flet-rive/README.md +++ b/sdk/python/packages/flet-rive/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-rive.svg)](https://pypi.python.org/pypi/flet-rive) [![downloads](https://static.pepy.tech/badge/flet-rive/month)](https://pepy.tech/project/flet-rive) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-rive/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-rive/LICENSE) A cross-platform [Flet](https://flet.dev) extension for displaying [Rive](https://rive.app/) animations. diff --git a/sdk/python/packages/flet-video/README.md b/sdk/python/packages/flet-video/README.md index 5a478372f0..64d2ee9b3a 100644 --- a/sdk/python/packages/flet-video/README.md +++ b/sdk/python/packages/flet-video/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-video.svg)](https://pypi.python.org/pypi/flet-video) [![downloads](https://static.pepy.tech/badge/flet-video/month)](https://pepy.tech/project/flet-video) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-video/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-video/LICENSE) A cross-platform video player for [Flet](https://flet.dev) apps. @@ -35,6 +35,20 @@ To install the `flet-video` package and add it to your project dependencies: ``` After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`. +> [!NOTE] +> To play video on Linux/WSL you need to install [`libmpv`](https://github.com/mpv-player/mpv) library: +> +> ```bash +> sudo apt update +> sudo apt install libmpv-dev libmpv2 +> ``` +> +> If you encounter `libmpv.so.1` load errors, run: +> +> ```bash +> sudo ln -s /usr/lib/x86_64-linux-gnu/libmpv.so /usr/lib/libmpv.so.1 +> ``` + ### Examples For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/video). diff --git a/sdk/python/packages/flet-webview/README.md b/sdk/python/packages/flet-webview/README.md index feffa8b3fb..dda41a0e5f 100644 --- a/sdk/python/packages/flet-webview/README.md +++ b/sdk/python/packages/flet-webview/README.md @@ -2,7 +2,7 @@ [![pypi](https://img.shields.io/pypi/v/flet-webview.svg)](https://pypi.python.org/pypi/flet-webview) [![downloads](https://static.pepy.tech/badge/flet-webview/month)](https://pepy.tech/project/flet-webview) -[![license](https://img.shields.io/github/license/flet-dev/flet.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-webview/LICENSE) +[![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-webview/LICENSE) A [Flet](https://flet.dev) extension for displaying web content in a WebView. diff --git a/sdk/python/packages/flet/docs/audio/index.md b/sdk/python/packages/flet/docs/audio/index.md index 2ef002bb72..26c480c827 100644 --- a/sdk/python/packages/flet/docs/audio/index.md +++ b/sdk/python/packages/flet/docs/audio/index.md @@ -37,9 +37,9 @@ pip install flet-audio # (1)! --8<-- "{{ examples }}/example_1.py" ``` -/// admonition | Windows Subsystem for Linux (WSL) +/// admonition | Linux/WSL (Windows Subsystem for Linux) type: note -On WSL, you need to install [`GStreamer`](https://github.com/GStreamer/gstreamer) library. +To play audio on Linux/WSL you need to install [`GStreamer`](https://github.com/GStreamer/gstreamer) library. If you receive `error while loading shared libraries: libgstapp-1.0.so.0`, it means `GStreamer` is not installed in your WSL environment. diff --git a/sdk/python/packages/flet/docs/charts/index.md b/sdk/python/packages/flet/docs/charts/index.md index 14cb56ba43..20c30f5227 100644 --- a/sdk/python/packages/flet/docs/charts/index.md +++ b/sdk/python/packages/flet/docs/charts/index.md @@ -32,9 +32,6 @@ pip install flet-charts # (1)! 1. After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`. /// -> [!TIP] -> All chart services are regular controls—simply instantiate them and add to the page or to a layout container. - ## Available Charts - [`BarChart`](bar_chart.md) diff --git a/sdk/python/packages/flet/docs/lottie/index.md b/sdk/python/packages/flet/docs/lottie/index.md index ef9ce1996d..2c011573f7 100644 --- a/sdk/python/packages/flet/docs/lottie/index.md +++ b/sdk/python/packages/flet/docs/lottie/index.md @@ -33,9 +33,6 @@ pip install flet-lottie # (1)! 1. After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`. /// -> [!TIP] -> `Lottie` is a visual control—place it wherever any other widget goes and configure playback via its properties. - ## Example ```python diff --git a/sdk/python/packages/flet/pyproject.toml b/sdk/python/packages/flet/pyproject.toml index eed18c1968..d4b1b022cc 100644 --- a/sdk/python/packages/flet/pyproject.toml +++ b/sdk/python/packages/flet/pyproject.toml @@ -13,7 +13,8 @@ dependencies = [ "oauthlib >=3.2.2; platform_system != 'Pyodide'", "httpx >=0.28.1; platform_system != 'Pyodide'", "repath >=0.9.0", - "msgpack >=1.1.0" + "msgpack >=1.1.0", + "typing-extensions; python_version < '3.11'" ] [project.urls] diff --git a/sdk/python/packages/flet/src/flet/controls/base_control.py b/sdk/python/packages/flet/src/flet/controls/base_control.py index 53ce84f735..69d1e7633c 100644 --- a/sdk/python/packages/flet/src/flet/controls/base_control.py +++ b/sdk/python/packages/flet/src/flet/controls/base_control.py @@ -16,13 +16,10 @@ logger = logging.getLogger("flet") controls_log = logging.getLogger("flet_controls") -# Try importing `dataclass_transform()` for Python 3.11+, else use a no-op function -if sys.version_info >= (3, 11): # Only use it for Python 3.11+ +if sys.version_info >= (3, 11): from typing import dataclass_transform else: - - def dataclass_transform(): # No-op decorator for older Python versions - return lambda x: x + from typing_extensions import dataclass_transform if TYPE_CHECKING: @@ -236,9 +233,9 @@ def will_unmount(self): def update(self) -> None: if hasattr(self, "_frozen"): raise Exception("Frozen control cannot be updated.") - assert self.page, ( - f"{self.__class__.__qualname__} Control must be added to the page first" - ) + assert ( + self.page + ), f"{self.__class__.__qualname__} Control must be added to the page first" self.page.update(self) async def _invoke_method( @@ -247,9 +244,9 @@ async def _invoke_method( arguments: Optional[dict[str, Any]] = None, timeout: Optional[float] = None, ) -> Any: - assert self.page, ( - f"{self.__class__.__qualname__} Control must be added to the page first" - ) + assert ( + self.page + ), f"{self.__class__.__qualname__} Control must be added to the page first" return await self.page.session.invoke_method( self._i, method_name, arguments, timeout