Build Material Design apps in pure Python โ runs on web, desktop and mobile via Flutter.
Flet is a Python framework that lets you build cross-platform apps using Google's Flutter rendering engine โ without writing Dart, HTML, or JavaScript. You write pure Python; Flet translates your code into Flutter widgets that run as a native desktop window, a mobile app, or a web page in the browser.
Flet was created by Appveyor Systems and targets developers who want modern Material Design UIs with minimal front-end knowledge. It is one of the fastest ways to ship a Python app that also runs in a browser.
main(page) function.ft.Text, ft.ElevatedButton, ft.TextField, ft.Column, etc.page.update().Row, Column, Stack, Container with alignment and spacing.page.views and page.go() for multi-page navigation.ft.app(view=ft.WEB_BROWSER)), or mobile.| Control | Purpose |
|---|---|
TextField | Text input |
ElevatedButton / OutlinedButton | Actions |
Checkbox / Switch / Slider | Boolean and numeric input |
Dropdown | Selection from list |
DataTable | Tabular data |
NavigationRail / AppBar | App chrome |
pip install flet
# Run as desktop app (default):
python main.py
# Run in browser:
# ft.app(target=main, view=ft.WEB_BROWSER)
import flet as ft
def main(page: ft.Page):
page.title = "Flet demo"
txt = ft.Text("0", size=30)
def add(e):
txt.value = str(int(txt.value) + 1)
page.update()
page.add(txt, ft.ElevatedButton("Add", on_click=add))
ft.app(target=main)
import flet as ft
def main(page: ft.Page):
page.title = "Login"
page.padding = 30
user = ft.TextField(label="Username")
pwd = ft.TextField(label="Password", password=True)
result = ft.Text()
def submit(e):
result.value = f"Hello, {user.value}"
page.update()
page.add(
ft.Column([
user, pwd,
ft.ElevatedButton("Sign in", on_click=submit),
result
], spacing=12)
)
ft.app(target=main)
import flet as ft
def main(page: ft.Page):
page.add(ft.Text("Running in your browser!", size=24))
# Opens at http://localhost:8550
ft.app(target=main, view=ft.WEB_BROWSER, port=8550)
page.update() after modifying controls โ Flet does not auto-refresh.page.theme_mode = ft.ThemeMode.DARK for dark mode.flet publish or host the Flet server behind a reverse proxy.flet==x.y.z).You want a modern cross-platform app (including web) from a single Python codebase without front-end skills. Compare with Kivy for mobile-first touch apps.
Useful guides and tools (from webpage_links.xlsx).