Skip to content

Events

Configure custom events

config_event_handler decorator to add Flet event configurations. The decorated function must receive the [page:ft.Page] parameter to be able to manipulate the app elements.

Example

  • Handle the event when the app is disconnected
@app.config_event_handler
def event_handler(page: ft.Page):

    def on_disconnect(e):
        print("Disconnect test application")

    page.on_disconnect = on_disconnect