|
1 |
| -# <img src="media/logo/flet-logo.svg" width="50%"/> |
| 1 | +# Flet |
| 2 | + |
| 3 | +<img src="media/logo/flet-logo.svg" width="50%"/> |
2 | 4 |
|
3 | 5 | [](https://ci.appveyor.com/project/flet-dev/flet/branch/main)
|
4 | 6 |
|
5 | 7 | Flet is a framework that enables you to easily build realtime web, mobile and desktop apps in your favorite language and securely share them with your team. No frontend experience required.
|
6 | 8 |
|
7 |
| -## <img src="https://flet.dev/img/pages/home/feature-bolt.svg" height="30px" /> From idea to app in minutes |
| 9 | +### ⚡From idea to app in minutes |
| 10 | + |
| 11 | +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 a great-looking interactive apps to serve a group of users. |
| 12 | + |
| 13 | +### 📐 Simple architecture |
| 14 | + |
| 15 | +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, realtime Single-Page Application (SPA). |
| 16 | + |
| 17 | +### 🔋Batteries included |
| 18 | + |
| 19 | +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 built-in web server with assets hosting and desktop clients. |
| 20 | + |
| 21 | +### <img src="media/flutter/icon_flutter.svg" height="20px" /> Powered by Flutter |
| 22 | + |
| 23 | +Flet UI is built with [Flutter](https://flutter.dev/), so your app looks professional and could be delivered to any platform. Flet simplifies Flutter model by combining smaller "widgets" to ready-to-use "controls" with imperative programming model. |
| 24 | + |
| 25 | +### 🌐 Speaks your language |
| 26 | + |
| 27 | +Flet is language-agnostic, so anyone on your team could develop Flet apps in their favorite language. [Python](https://flet.dev/docs/getting-started/python) is already supported, Go, C# and others are [coming next](https://flet.dev/docs/roadmap). |
| 28 | + |
| 29 | +### 📱 Deliver to any device |
| 30 | + |
| 31 | +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](https://web.dev/what-are-pwas/) or view via Flet app for iOS and Android. |
| 32 | + |
| 33 | +## Flet app example |
| 34 | + |
| 35 | +At the moment you can write Flet apps in Python and other languages will be added soon. |
| 36 | + |
| 37 | +Here is a sample "Counter" app: |
| 38 | + |
| 39 | +```python title="counter.py" |
| 40 | +import flet |
| 41 | +from flet import IconButton, Page, Row, TextField, icons |
| 42 | + |
| 43 | +def main(page: Page): |
| 44 | + page.title = "Flet counter example" |
| 45 | + page.vertical_alignment = "center" |
| 46 | + |
| 47 | + txt_number = TextField(value="0", text_align="right", width=100) |
| 48 | + |
| 49 | + def minus_click(e): |
| 50 | + txt_number.value = int(txt_number.value) - 1 |
| 51 | + page.update() |
| 52 | + |
| 53 | + def plus_click(e): |
| 54 | + txt_number.value = int(txt_number.value) + 1 |
| 55 | + page.update() |
| 56 | + |
| 57 | + page.add( |
| 58 | + Row( |
| 59 | + [ |
| 60 | + IconButton(icons.REMOVE, on_click=minus_click), |
| 61 | + txt_number, |
| 62 | + IconButton(icons.ADD, on_click=plus_click), |
| 63 | + ], |
| 64 | + alignment="center", |
| 65 | + ) |
| 66 | + ) |
| 67 | + |
| 68 | +flet.app(target=main) |
| 69 | +``` |
| 70 | + |
| 71 | +To run the app install `flet` module: |
| 72 | + |
| 73 | +```bash |
| 74 | +pip install flet |
| 75 | +``` |
| 76 | + |
| 77 | +and run the program: |
| 78 | + |
| 79 | +```bash |
| 80 | +python counter.py |
| 81 | +``` |
| 82 | + |
| 83 | +The app will be started in a native OS window - what a nice alternative to Electron! |
| 84 | + |
| 85 | +<img src="https://flet.dev/img/docs/getting-started/flet-counter-macos.png" width="45%" /> |
| 86 | + |
| 87 | + |
| 88 | +Now, if you want to run the app as a web app, just replace the last line with: |
| 89 | + |
| 90 | +```python |
| 91 | +flet.app(target=main, view=flet.WEB_BROWSER) |
| 92 | +``` |
| 93 | + |
| 94 | +run again and now you instantly get a web app: |
| 95 | + |
| 96 | +<img src="https://flet.dev/img/docs/getting-started/flet-counter-safari.png" width="60%" /> |
| 97 | + |
| 98 | +## Getting started |
| 99 | + |
| 100 | +* [Creating Flet apps in Python](https://flet.dev/docs/getting-started/python) |
| 101 | +* [Controls reference](https://flet.dev/docs/controls) |
| 102 | + |
| 103 | +## Sample apps |
| 104 | + |
| 105 | +* [Greeter](sdk/python/examples/apps/greeter/greeter.py) |
| 106 | +* [Counter](sdk/python/examples/apps/counter/counter-home.py) |
| 107 | +* [To-Do](sdk/python/examples/apps/todo/todo.py) |
| 108 | +* [Icons Browser](sdk/python/examples/apps/icons-browser/icons-browser.py) ([Online Demo](https://flet-icons-browser.fly.dev/)) |
| 109 | + |
| 110 | +## Community |
8 | 111 |
|
9 |
| -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 a great-looking interactive apps to serve a group of users. |
| 112 | +* [Discussions](https://github.com/flet-dev/flet/discussions) |
| 113 | +* [Discord](https://discord.gg/dhYUcB3R) |
| 114 | +* [Twitter](https://twitter.com/fletdev) |
| 115 | +* [Email](mailto:hello@flet.dev) |
0 commit comments