Flet-Easy is a package created as a Flet add-on, designed to be easy to use with a cleaner order in the code, having many customizable features.
Project description
🔥Flet-Easy
Flet-Easy
is a package built as an add-on for Flet
, designed for beginners what it does is to make Flet
easier when building your apps, with a tidier and simpler code. Some functions:
- Facilitates the handling of flet events.
- Page building using decorators, which allows you to make numerous custom configurations to flet for desktop, mobile and website application.
- Designed to work with numerous pages of your created application.
- Provides better MVC construction of your code, which can be scalable and easy to read.
- Not only limits the MVC model but you can customize it according to your preferences.
- Customized URLs for more precision in sending data.
- Support asynchronous.
- Supports Application Packaging for distribution.
and more extra features.....
📌Flet events it handles
on_route_change
: Dynamic routingon_view_pop
on_keyboard_event
on_resize
on_error
💻Installation:
Requires installation for use:
Flet
(Installed automatically)Flet-fastapi
(Optional)uvicorn
(Optional)
pip install flet-easy
💻Update:
pip install flet-easy --upgrade
🔥Flet-Easy app example
Here is an example of an application with 2 pages, "Home" and "Counter":
import flet as ft
import flet_easy as fs
app = fs.FletEasy(route_init="/flet-easy")
# We add a page
@app.page(route="/flet-easy")
def index_page(data: fs.Datasy):
page = data.page
page.title = "Flet-Easy"
def go_counter(e):
page.go("/counter")
return ft.View(
route="/flet-easy",
controls=[
ft.Text("Home page"),
ft.FilledButton("Go to Counter", on_click=go_counter),
],
vertical_alignment=ft.MainAxisAlignment.CENTER,
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
)
# We add a second page
@app.page(route="/counter")
def counter_page(data: fs.Datasy):
page = data.page
page.title = "Counter"
txt_number = ft.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()
def go_home(e):
page.go("/flet-easy")
return ft.View(
route="/counter",
controls=[
ft.Row(
[
ft.IconButton(ft.icons.REMOVE, on_click=minus_click),
txt_number,
ft.IconButton(ft.icons.ADD, on_click=plus_click),
],
alignment="center",
),
ft.FilledButton("Go to Home", on_click=go_home),
],
vertical_alignment=ft.MainAxisAlignment.CENTER,
horizontal_alignment=ft.CrossAxisAlignment.CENTER,
)
# We run the application
app.run()
🚀 How to use Flet-Easy
?
[!IMPORTANT] https://daxexs.github.io/flet-easy/
👀 Code examples:
🧾 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flet_easy-0.1.1.tar.gz
(1.9 MB
view hashes)
Built Distribution
flet_easy-0.1.1-py3-none-any.whl
(20.3 kB
view hashes)
Close
Hashes for flet_easy-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 503dc07fa3883fe7f93434a4c7ab9b2814dd5cbad20dafb85484b22f75d393f5 |
|
MD5 | 77466af56893dd356bcf1124c38325fa |
|
BLAKE2b-256 | 5c16265384386f93180b2cb11e731f16722d7ef8e676f9790399641451c08bea |