Begin¶
Flet-Easy¶
Flet-Easy is a package built as an add-on for Flet, designed for beginners, what it does is to facilitate the use of Flet when building your applications, with a tidier and simpler code.
Features¶
- Easy to use (hence the name).
 - Facilitates 
fletevent handling. - Simple page routing for whichever one suits you best. [
See more] - App construction with numerous pages and custom flet configurations for desktop, mobile and web sites.
 - Provides a better construction of your code, which can be scalable and easy to read (it adapts to your preferences, there are no limitations).
 - Dynamic routing, customization in the routes for greater accuracy in sending data. [
See more] - Routing protection [
See more] - Custom Page 404 [
See more] - Asynchronous support.
 - Working with other applications. [
See more] - Easy integration of 
on_keyboard_eventin each of the pages. [See more] - Use the percentage of the page width and height of the page with 
on_resize. [See more] ResponsiveControlsycontrol to make the app responsive, useful for desktop applications. [See more]- Soporta Application Packaging para su distribución. [
See more] 
Flet events it handles¶
on_route_change: Dynamic routingon_view_popon_keyboard_eventon_resizeon_error
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):
    data.page.title = "Flet-Easy"
    return ft.View(
        controls=[
            ft.Text("Home page"),
            ft.FilledButton("Go to Counter", key="/counter", on_click=data.go),
        ],
        vertical_alignment="center",
        horizontal_alignment="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()
    return ft.View(
        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", key="/flet-easy", on_click=data.go),
        ],
        vertical_alignment="center",
        horizontal_alignment="center",
    )
# We run the application
app.run()
🎬 Demo¶
