Flet Dropzone control
Dropzone control for Flet integrating desktop_drop
Installation
pip install flet-dropzone
⚠️ Please build once before running.
⚠️ Please build once before running.
⚠️ Please build once before running.
for windows user:
flet build windows -v
for macOS user:
flet build macos -v
for linux user:
flet build linux -v
for web user:
flet build web -v
Example
import flet as ft
import flet_dropzone as ftd
def main(page: ft.Page):
page.vertical_alignment = ft.MainAxisAlignment.CENTER
page.horizontal_alignment = ft.CrossAxisAlignment.CENTER
async def on_dropped(e: ftd.DropzoneEvent):
for file in e.files:
data = await e.control.read_bytes(file)
print(f"Dropped: {file.name} ({len(data)} bytes) from {file.path}")
page.add(
ftd.Dropzone(
content=ft.Container(
ft.Text("Drop here!"),
width=500,
height=500,
alignment=ft.Alignment.CENTER,
bgcolor="red",
),
on_dropped=on_dropped,
on_entered=lambda e: print("Entered"),
on_exited=lambda e: print("Exited"),
)
)
ft.run(main)
DropzoneEvent.files is a list of DropzoneFile objects with name and path
properties. On desktop platforms path is a real file path, while on web it is
a temporary blob: URL — use Dropzone.read_bytes() to get the file content on
any platform.
References
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flet_dropzone-0.4.0.tar.gz.
File metadata
- Download URL: flet_dropzone-0.4.0.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dede0c401dd20d0d90c950d1dcb396664b11da25da8a152b2770ee2bc825c44b
|
|
| MD5 |
520502852675bbf0d37354cc67070be9
|
|
| BLAKE2b-256 |
74a3fc72d64a7f3756d21636715a80b9632aca58ac3751550d96b0db929dd26b
|
File details
Details for the file flet_dropzone-0.4.0-py3-none-any.whl.
File metadata
- Download URL: flet_dropzone-0.4.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7e47c5ffed70d09ecd9079454f7678f9d4d4bd88cf1432f7e12489ca4987a6d
|
|
| MD5 |
2de246beafb749984b351c659d644883
|
|
| BLAKE2b-256 |
df671d07086500987ec47454d558ec408405498ac2ac9ac4896039cec3cfdc4b
|