https://github.com/shiena/flet-blur
Adding nice transparency effect to your Flet App
https://github.com/shiena/flet-blur
flet python
Last synced: 5 months ago
JSON representation
Adding nice transparency effect to your Flet App
- Host: GitHub
- URL: https://github.com/shiena/flet-blur
- Owner: shiena
- License: apache-2.0
- Created: 2025-03-02T10:32:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-29T10:41:09.000Z (about 1 year ago)
- Last Synced: 2025-06-02T09:20:54.134Z (about 1 year ago)
- Topics: flet, python
- Language: Dart
- Homepage: https://pypi.org/project/flet-blur/
- Size: 29.3 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flet - flet-blur - Adding nice transparency effect to your Flet App (Uncategorized / Uncategorized)
README
# Flet Blur control
Blur control for [Flet](https://flet.dev/) integrating [flutter_acrylic](https://pub.dev/packages/flutter_acrylic)
## Installation
```bash
pip install flet-blur
```
Please build once before running.
for windows user:
```bash
flet build windows -v
```
for macOS user:
```bash
flet build macos -v
```
for linux user:
```bash
flet build linux -v
```
## Example
```py
import flet as ft
import flet_blur as ftb
def main(page: ft.Page):
bgblur = ftb.Blur()
def on_click(
effect: ftb.WindowEffect,
color: ft.Colors = ft.Colors.TRANSPARENT,
dark: bool = True,
):
async def f(e):
await bgblur.set_window_effect(effect, color, dark)
return f
page.overlay.append(bgblur)
page.bgcolor = ft.Colors.TRANSPARENT
page.add(
ft.Text("Acrylic!"),
ft.ElevatedButton(
"transparent",
on_click=on_click(ftb.WindowEffect.TRANSPARENT, ft.Colors.BLACK, False),
),
ft.ElevatedButton(
"solid", on_click=on_click(ftb.WindowEffect.SOLID, ft.Colors.RED, True)
),
ft.ElevatedButton(
"aero", on_click=on_click(ftb.WindowEffect.AERO, ft.Colors.BLUE, False)
),
ft.ElevatedButton(
"acrylic",
on_click=on_click(ftb.WindowEffect.ACRYLIC, ft.Colors.GREEN, True),
),
ft.ElevatedButton(
"mica",
on_click=on_click(ftb.WindowEffect.MICA, ft.Colors.TRANSPARENT, False),
),
ft.ElevatedButton(
"tabbed", on_click=on_click(ftb.WindowEffect.TABBED, ft.Colors.BLACK, True)
),
ft.ElevatedButton(
"disabled",
on_click=on_click(ftb.WindowEffect.DISABLED, ft.Colors.BLACK, False),
),
)
ft.run(main)
```
## Known issues
Some effects do not work, see https://github.com/alexmercerind/flutter_acrylic/issues .
## Reference
- https://github.com/flet-dev/flet/pull/4441