Skip to main content

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

githubpypi

Downloads pdm-managed

logo

🔥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 routing
  • on_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:

[!NOTE] https://github.com/Daxexs/flet-easy/tree/main/tests

🧾 License

Apache License 2.0

Project details


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)

Uploaded Source

Built Distribution

flet_easy-0.1.1-py3-none-any.whl (20.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page