底层基于flutter,可以全Python实现前后端,前端可以采用Web方式,也可以编译成Android、IOS、MacOS、Windows和Linux多端的客户端。

Feodor Fitsner 76fc5ca98a Yield 404 if page not found and URL strategy is "hash" 7 月之前
.github 21f10268c8 Proper formatting of a question in bug_report.md (#2540) 8 月之前
ci fe1a4d15fb `Audio`, `AudioRecorder`, `Video` and `WebView` controls moved to separate Flutter packages (#2579) 8 月之前
client 9d5f26a115 Prepare Flet 0.21.0 release (#2783) 7 月之前
docs 1b246dbb75 Delete ios.md 1 年之前
media 9f97fdd6e3 `flet build` command to package Flet app for any platform (#2271) 9 月之前
packages 577ebb5b31 Fix error when sending event before backend is initialized (#2803) 7 月之前
sdk 76fc5ca98a Yield 404 if page not found and URL strategy is "hash" 7 月之前
server 24b8004401 `Page.design` property (#2607) 8 月之前
.appveyor.yml 2b04c89cf5 FastAPI instead of built-in Fletd server. Mixed async/sync apps. (#2700) 7 月之前
.gitattributes ee6cb28fb9 Squashed commit of the following: 2 年之前
.gitignore adb15f7797 `CupertinoButton` Control (#2495) 8 月之前
CHANGELOG.md 9d5f26a115 Prepare Flet 0.21.0 release (#2783) 7 月之前
CONTRIBUTING.md dd59ff2af7 Update Contribution Guide (#2366) 9 月之前
LICENSE 71c229e8b6 Initial commit 2 年之前
README.md d80edf38e6 Fix types and make code consistent with docs. (#2364) 9 月之前

README.md

Flet

Build status

Flet is a framework that enables you to easily build real-time web, mobile, and desktop apps in your favorite language and securely share them with your team. No frontend experience is required.

⚡From idea to app in minutes

An internal tool or a dashboard for your team, weekend project, data entry form, kiosk app, or high-fidelity prototype - Flet is an ideal framework to quickly hack great-looking interactive apps to serve a group of users.

📐 Simple architecture

No more complex architecture with JavaScript frontend, REST API backend, database, cache, etc. With Flet you just write a monolith stateful app in Python only and get multi-user, real-time Single-Page Application (SPA).

🔋Batteries included

To start developing with Flet, you just need your favorite IDE or text editor. No SDKs, no thousands of dependencies, no complex tooling - Flet has a built-in web server with assets hosting and desktop clients.

   Powered by Flutter

Flet UI is built with Flutter, so your app looks professional and could be delivered to any platform. Flet simplifies the Flutter model by combining smaller "widgets" to ready-to-use "controls" with an imperative programming model.

🌐 Speaks your language

Flet is language-agnostic, so anyone on your team could develop Flet apps in their favorite language. Python is already supported, Go, C# and others are coming next.

📱 Deliver to any device

Deploy Flet app as a web app and view it in a browser. Package it as a standalone desktop app for Windows, macOS, and Linux. Install it on mobile as PWA or view via Flet app for iOS and Android.

Flet app example

At the moment you can write Flet apps in Python and other languages will be added soon.

Here is a sample "Counter" app:

import flet
from flet import IconButton, Page, Row, TextField, icons

def main(page: Page):
    page.title = "Flet counter example"
    page.vertical_alignment = "center"

    txt_number = TextField(value="0", text_align="right", width=100)

    def minus_click(e):
        txt_number.value = str(int(txt_number.value) - 1)
        page.update()

    def plus_click(e):
        txt_number.value = str(int(txt_number.value) + 1)
        page.update()

    page.add(
        Row(
            [
                IconButton(icons.REMOVE, on_click=minus_click),
                txt_number,
                IconButton(icons.ADD, on_click=plus_click),
            ],
            alignment="center",
        )
    )

flet.app(target=main)

To run the app install flet module:

pip install flet

and run the program:

python counter.py

The app will be started in a native OS window - what a nice alternative to Electron!

Now, if you want to run the app as a web app, just replace the last line with:

flet.app(target=main, view=flet.AppView.WEB_BROWSER)

run again and now you instantly get a web app:

Getting started

Sample apps in Python

More demo applications can be found in the gallery.

Community

Contribute to this wonderful project